Initial commit
This commit is contained in:
commit
f242d2b0df
420 changed files with 62521 additions and 0 deletions
13
2023/day18/day18.bqn
Normal file
13
2023/day18/day18.bqn
Normal file
|
@ -0,0 +1,13 @@
|
|||
⟨Split⟩←•Import"../bqn-libs/strings.bqn"
|
||||
ds‿ls‿cs←<˘⍉>" "⊸Split¨•FLines"input"
|
||||
|
||||
Area←{𝕊d‿l:
|
||||
p←+`l×d⊏⟨0‿1,1‿0,0‿¯1,¯1‿0⟩
|
||||
a←|2÷˜-´+˝(⌽˘1⊸⌽)⊸×>p
|
||||
⌈a+1+(+´l)÷2
|
||||
}
|
||||
|
||||
•Show Area⟨"RDLU"⊐∾ds,•ParseFloat¨ls⟩
|
||||
|
||||
Hex2Num←{16⊸×⊸+˜´⌽(∾"0a"+⟜↕¨10‿6)⊐𝕩}
|
||||
•Show Area <˘⍉Hex2Num¨>5⊸(↓⋈↑)¨2⊸↓¨¯1⊸↓¨cs
|
Loading…
Add table
Add a link
Reference in a new issue