Module day23

Source
Expand description

§Unstable Diffusion

We represent elves as bits in a integer then use bitwise operations to efficiently figure out the movement for multiple elves at once.

Structs§

Input
U256
Duct tape two u128s together.

Enums§

Direction 🔒

Constants§

HEIGHT 🔒
The initial grid is 70 x 70. Elves stop moving when no other elf is adjacent so the grid will expand at most 70 in any direction, giving 70 + 70 + 70 = 210 total.

Functions§

parse
Converts the ASCII grid into a bit per elf.
part1
part2
step 🔒