Module day10

Module day10 

Source
Expand description

ยงFactory

Structsยง

Basis ๐Ÿ”’
Machine
Subspace ๐Ÿ”’

Constantsยง

MAX_BUTTONS ๐Ÿ”’
MAX_JOLTAGES ๐Ÿ”’

Functionsยง

configure_joltages ๐Ÿ”’
Convert the buttons and joltages to simultaneous equations, then use Gaussian Elimination to reduce (the up to 13) dimensions of the full solution space to a (between 0 and 3) dimensional subspace of only the free variables.
configure_lights ๐Ÿ”’
Check all patterns with one set bit, then patterns with two set bits, and so on, returning early as soon as we find a match without checking all possible combinations.
gaussian_elimination ๐Ÿ”’
parse
parse_machine ๐Ÿ”’
Convert light patterns and buttons to bitmasks to speed up part one.
part1
part2
recurse ๐Ÿ”’

Type Aliasesยง

Column ๐Ÿ”’