Day 3 well suited to JQ
Part 2
#!/usr/bin/env jq -n -R -f
reduce (
inputs | scan("do\\(\\)|don't\\(\\)|mul\\(\\d+,\\d+\\)")
| [[scan("(do(n't)?)")[0]], [ scan("\\d+") | tonumber]]
) as [[$do], [$a,$b]] (
{ do: true, s: 0 };
if $do == "do" then .do = true
elif $do then .do = false
elif .do then .s = .s + $a * $b end
) | .s
Day 8
Al lot of grid index shuffling these past few days! Not too difficult yet though, will this year be gentler or much harsher later?
Part 2 code in JQ
#!/usr/bin/env jq -n -R -f