| Copyright | (c) Eric Mertens 2021 |
|---|---|
| License | ISC |
| Maintainer | emertens@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
Main
Description
https://adventofcode.com/2021/day/24
These programs were composed of 14 nearly-identical program chunks
each of which varies in 3 parameters. Some of these chunks will
always increase the z register and others have the potential to
decrease z. Successfully validating an input will require all
blocks with decrease potential to actually decrease. The pick
implementation will only choose a parameter that would decrease
in one of these cases.
Documentation
Arguments
| :: [Int] | input digit guesses in order of preference |
| -> [(Int, Int, Int)] | program blocks |
| -> Int | first valid input |
Compute the input string that satisfies the given program.
Arguments
| :: [Int] | input digit guesses in order of preference |
| -> (Int, Int, Int) | block parameters |
| -> Int | starting z value |
| -> [(Int, Int)] | selected input value and resulting output z |
Compute the possible input choices and resulting z from each choice.