My solution for today, pretty similar to day 2 of ...
# advent-of-code
k
My solution for today, pretty similar to day 2 of course. It took me a while to figure out why part 1 doesn't crash given that some opcodes haven't been defined yet!
b
While I like how you grouped add and mul I would not allow your grouping of jump or lt/eq through a code review 😉 While they are inventive ways of reducing code duplication I have to stare at them far to long to understand them, but maybe I’m just slow 😅
k
Yeah I agree they're not super readable, maybe I should have figured out some better variable names. Both
cmp
and
expectTrue
aren't great.
Ah wait I can replace
(read(1) == 0) xor expectTrue
with
(read(1) != 0) == expectTrue
.