Copyright | (c) Eric Mertens 2020 |
---|---|
License | ISC |
Maintainer | emertens@gmail.com |
Safe Haskell | None |
Language | Haskell2010 |
https://adventofcode.com/2020/day/14
>>> :set -XQuasiQuotes
>>> :{
let cmds = [format|- ((mask = M*|mem[%u] = %u)%n)*|]
"mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0Xn
mem[8] = 11n
mem[7] = 101n
mem[8] = 0n"
in run1 [] IntMap.empty cmds
:}
165
>>> :{
let cmds = [format|- ((mask =
M*|mem[%u] = %u)%n)*|]
"mask = 000000000000000000000000000000X1001Xn
mem[42] = 100n
mask = 00000000000000000000000000000000X0XXn
mem[26] = 1n"
in run2 [] IntMap.empty cmds
:}
208