You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
698 B
Plaintext

1 year ago
$ #.##..##.
$ ..#.##.#.
$ ##......#
$ ##......#
$ ..#.##.#.
$ ..##..##.
$ #.#.##.#.
$
$ #...##..#
$ #....#..#
$ ..##..###
$ #####.##.
$ #####.##.
$ ..##..###
$ #....#..#
TestInput ←
Parse ← ⊜(□=@#⊜∘≠@\n.)¬⌕"\n\n".
PartI ← +⊙(×100)∩(
-⊃(⧻|×2+1⊚|:)≡≍⬚0↻1..
/+▽⊓(≡(/×≡≍⇌.↘)⊙¤|+1⊚)
)⍉.°□
# apparently adding a comment here fixes highlighting lol
PartII ← +⊙(×100)∩(
-⊃(⧻|×2+1⊚|:)⍜(⊢⇌|⋅0)+1⊚⧻.?
/+▽⊓(≡(×⊃(/×+|=2/+)≡⊃(=1/+≠|≍)⇌.↘)⊙¤|+1⊚)
)⍉.°□
/+≡PartI Parse TestInput
/+≡PartII Parse TestInput
/+≡PartI Parse &fras "day13.in"
/+≡PartII Parse &fras "day13.in"