adventofcode

https://adventofcode.com/
Log | Files | Refs

commit df146d6e83e0805d18d9aae8786bae9adb56fe88
parent a62f6ffa9769f78206c09c59f942daec20c91f73
Author: mpizzzle <m@michaelpercival.xyz>
Date:   Wed,  2 Feb 2022 18:06:25 +0000

puzzle 11 parts 1 + 2 complete

Diffstat:
A2021/puzzle_11.dyalog | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/2021/puzzle_11.dyalog b/2021/puzzle_11.dyalog @@ -0,0 +1,11 @@ +test ← ⊂⍎¨10 10⍴'5483143223274585471152645561736141336146635738547841675246452176841721688288113448468485545283751526' +input ← ⊂⍎¨10 10⍴'1443582148655373485114517412468835218864166231726217316566231128178367584235166566773268437381433267' + +b ← 9>⍨⊢ +Dumbo ← { + f ← (1 + ⊃⍵) + (((+/+⌿⍤⊢) ⌺ 3 3) ⊢)⍤b⍤⊢ + (⊂ (⊢×~⍤b⍤⊢) f ⍣ (⊢(100 = +/⍤(+⌿=⍥b)) f) 1 + ⊃⍵) , ⍺⍺ ⍵ +} + ++/+⌿ ⊃ +⌿ 0 = ((⊢ Dumbo) ⍣ 100) input ⍝ part 1 +1 -⍨ 1 ↓ ((1+1↓⊢) Dumbo) ⍣ (0=(+/+⌿⍤⊃⍤⊢)) (⊃ input) 0 ⍝ part 2