Source: Day 11: Reactor
Full solution for today (spoilers!).
Part 1
Given a directed graph defined where
aaa: you hhhmeansaaais connected toyouandhhh, how many paths are there fromyoutoout.
Full solution for today (spoilers!).
Given a directed graph defined where
aaa: you hhhmeansaaais connected toyouandhhh, how many paths are there fromyoutoout.
Full solution for today (spoilers!).
Implement a PRNG with the following update function:
- Multiply by 64, xor with the previous value, modulo 16777216
- Divide by 32, xor with the previous value (from step 1), modulo 16777216
- Multiply by 2048, xor with the previous value (from step 2), module 16777216
For each of a series of seeds, sum the 2000th generated number.
Full solution for today (spoilers!).
The input is a list of pairs of the form
a|bwhich defines thatbmust not come beforea, an empty line, and then a list of valuesa,b,c,d.For each line that is valid for all given
a|brules, sum the middle number of each list.
Two posts in two days? Madness!
But really, it got a bit late yesterday so I figured I’d split this into two different posts.
Let’s continue StackLang Part VII: New CLI and Datatypes and implement lists stacks in the compiler!
In this post:
We’ve gone through all sorts of things building up the StackLang language so far:
But what can we actually do with it?
It’s been a bit, but I hope it’s worth it. StackLang, part 5: compiling to C!
StackLang, part 4: an interpreter. Here we go again!
This time, the goal is to actually get code running
StackLang, part 3: parsing. This is going to be the most complicated one thus far! Onward.