Module advent_solutions::advent2017::day15
[−]
[src]
Day 15: Dueling Generators
Here, you encounter a pair of dueling generators. The generators, called generator A and generator B, are trying to agree on a sequence of numbers. However, one of them is malfunctioning, and so the sequences don't always match.
As they do this, a judge waits for each of them to generate its next value, compares the lowest 16 bits of both values, and keeps track of the number of times those parts of the values match.
Structs
| Generator |
The generators both work on the same principle. To create its next
value, a generator will take the previous value it produced, multiply it
by a factor (generator A uses |
Functions
| parse_input | |
| part1 |
Here, you can see that the lowest (here, rightmost) 16 bits of the third
value match: |
| part2 |
In the interest of trying to align a little better, the generators get more picky about the numbers they actually give to the judge. |