chiark
/
gitweb
/
~bjharris
/
aoc-2022.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1a22be4
)
18a: comment correction
author
Ben Harris
<bjh21@bjh21.me.uk>
Sat, 25 May 2024 23:12:29 +0000
(
00:12
+0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Sat, 25 May 2024 23:12:29 +0000
(
00:12
+0100)
18/18a.bqn
patch
|
blob
|
history
diff --git
a/18/18a.bqn
b/18/18a.bqn
index 0d0e06f7cc3df8e8240d4db08dd6addafd577dfc..f467a13ce241c487394564f40a7e5caf4fc2e6d1 100644
(file)
--- a/
18/18a.bqn
+++ b/
18/18a.bqn
@@
-9,13
+9,13
@@
Prep←{
cubes←{
•ParseFloat¨(','=𝕩)Split 𝕩
}¨𝕩
+ # We assume that all co-ordinates are non-negitive.
# "2" here allows a margin for shifting into
droplet←(2+⌈˝>cubes)⥊0
droplet↩1¨⌾(cubes⊸⊑)droplet
}
Main←{ 𝕊 droplet:
- # We assume that all co-ordinates are strictly positive.
NSurfacesInDir←{ +´⥊𝕩≠»𝕩 }
+´{NSurfacesInDir ⍉⍟𝕩 droplet}¨↕=droplet
}