about summary refs log tree commit diff
path: root/day17.bqn
diff options
context:
space:
mode:
Diffstat (limited to 'day17.bqn')
-rw-r--r--day17.bqn10
1 files changed, 10 insertions, 0 deletions
diff --git a/day17.bqn b/day17.bqn
new file mode 100644
index 0000000..f85adbf
--- /dev/null
+++ b/day17.bqn
@@ -0,0 +1,10 @@
+lx‿ux←209‿238 ⋄ ly‿uy←¯86‿¯59
+
+# •Show ÷⟜2 (⊣ × -⟜1) |⊑y
+•Show +´↕|ly
+
+Check ← { ⟨⟨x,y⟩,⟨vx,vy⟩⟩: { (lx≤x)∧(x≤⊑ux)∧(ly≤y)∧(y≤uy) ? 1 ;
+                             y < ly ? 0 ;
+                             Check ⟨⟨x+vx, y+vy⟩, ⟨vx-×vx, vy-1⟩⟩ } }
+
+•Show +´ ⥊ {Check ⟨0,0⟩‿𝕩}¨ (<1⋈ly)+↕⟨ux,2×|ly⟩