2021 day 11
This commit is contained in:
parent
1412646bd1
commit
08d93ade69
4 changed files with 38 additions and 0 deletions
13
2021/day11/day11.bqn
Normal file
13
2021/day11/day11.bqn
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
in←'0'-˜>•FLines"input"
|
||||||
|
|
||||||
|
fs←⟨«,»,«˘,»˘,»∘(»˘),«∘(«˘),«∘(»˘),«˘∘»⟩
|
||||||
|
Flash←{𝕊flashed‿m:
|
||||||
|
flashed+↩9<m
|
||||||
|
⟨flashed,(¬flashed)×m++´fs{𝕎𝕩}¨<9<m⟩
|
||||||
|
}
|
||||||
|
Step←{𝕊f‿m:
|
||||||
|
Flash•_while_{∨´⥊9<1⊑𝕩} ⟨(≢f)⥊0,1+m⟩
|
||||||
|
}
|
||||||
|
•Show +´⥊+´⊑¨Step⍟(1+↕100)⟨(≢in)⥊0,in⟩
|
||||||
|
|
||||||
|
•Show ⊑/∧´∘⥊¨⊑¨Step⍟(↕300)⟨(≢in)⥊0,in⟩
|
10
2021/day11/input
Normal file
10
2021/day11/input
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
8261344656
|
||||||
|
7773351175
|
||||||
|
7527856852
|
||||||
|
1763614673
|
||||||
|
8674556743
|
||||||
|
6853382153
|
||||||
|
4135852388
|
||||||
|
2846715522
|
||||||
|
7477425863
|
||||||
|
4723888888
|
5
2021/day11/smalltest
Normal file
5
2021/day11/smalltest
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
11111
|
||||||
|
19991
|
||||||
|
19191
|
||||||
|
19991
|
||||||
|
11111
|
10
2021/day11/test
Normal file
10
2021/day11/test
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
5483143223
|
||||||
|
2745854711
|
||||||
|
5264556173
|
||||||
|
6141336146
|
||||||
|
6357385478
|
||||||
|
4167524645
|
||||||
|
2176841721
|
||||||
|
6882881134
|
||||||
|
4846848554
|
||||||
|
5283751526
|
Loading…
Add table
Add a link
Reference in a new issue