Initial commit
This commit is contained in:
commit
f242d2b0df
420 changed files with 62521 additions and 0 deletions
15
2023/day14/day14.bqn
Normal file
15
2023/day14/day14.bqn
Normal file
|
@ -0,0 +1,15 @@
|
|||
input←>•FLines"input"
|
||||
|
||||
Slide←{
|
||||
sinds←¯1∾/'#'=𝕩
|
||||
inds←∾(≠↑sinds˙)⊸+1+↕¨≠¨⊔1-˜+˝sinds<⌜/'O'=𝕩
|
||||
'O'˙¨⌾(inds⊸⊏) '#'˙¨⌾((1↓sinds)⊸⊏) (≠𝕩)⥊'.'
|
||||
}
|
||||
Load←+´((⌽1+(↕≠))×(+´˘'O'⊸=))
|
||||
•Show Load Slide˘⌾⍉ input
|
||||
|
||||
Cycle←{Slide˘⌾(⌽˘) Slide˘⌾(⍉⌽) Slide˘ Slide˘⌾⍉ 𝕩}
|
||||
c←{(<Cycle⊑𝕩)∾𝕩}•_while_{¬⊑(<⊑𝕩)∊1↓𝕩} ⟨input⟩
|
||||
a‿m←-˜`/⌽((<⊑)≡¨⊢)c
|
||||
•Show Load ((m×⌈a÷m)+m|1e9)⊑⌽c
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue