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:
c1e53f9
)
14b done
author
Ben Harris
<bjh21@bjh21.me.uk>
Tue, 14 May 2024 16:19:58 +0000
(17:19 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Tue, 14 May 2024 16:19:58 +0000
(17:19 +0100)
I dodged the bug by sticking the floor on by simpler means.
14/14b.bqn
patch
|
blob
|
history
diff --git
a/14/14b.bqn
b/14/14b.bqn
index c2ec0171ca19705ca05a07e7e24f1f3aa94ad85f..dba86fa90b66406e7168802e40d8fcb19429fad1 100644
(file)
--- a/
14/14b.bqn
+++ b/
14/14b.bqn
@@
-25,10
+25,10
@@
RectIndices←{
Plot←{
# Assume all co-ordinates are positive.
- ⟨max_x, max_y⟩ ← (
⟨1,3⟩
+⌈˝>∾𝕩)
- max_x ↩ max_x ⌈ 50
0
+max_y
+ ⟨max_x, max_y⟩ ← (
1
+⌈˝>∾𝕩)
+ max_x ↩ max_x ⌈ 50
2
+max_y
map←⟨max_x,max_y⟩⥊0
- map ↩
1¨⌾(¯1⊸⊏˘) map # Solid floor
+ map ↩
∾⟜⟨0,1⟩˘map
{𝕊⟨from,to⟩:
map ↩ 1¨⌾((from RectIndices to)⊸⊑) map
}˘∾2↕¨𝕩