chiark / gitweb /
04b done
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 4 May 2024 08:41:12 +0000 (09:41 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 4 May 2024 08:41:12 +0000 (09:41 +0100)
04/04b.bqn [new file with mode: 0644]

diff --git a/04/04b.bqn b/04/04b.bqn
new file mode 100644 (file)
index 0000000..8832e63
--- /dev/null
@@ -0,0 +1,15 @@
+Split←{
+  delims←𝕩∊",-"
+  blocknums ← +`delims
+  # Set entries in blocknums to -1 when they correspond with delims.
+  blocknums ↩ (¯1¨)⌾(delims⊸/) blocknums
+  blocknums⊔𝕩
+}
+
+Prep←{⍉>•ParseFloat¨¨Split¨𝕩}
+
+Main←{𝕊[x0,x1,y0,y1]:
+  +´((x0≤y1)∧(x1≥y0))∨((y0≤x1)∧(y1≥x0))
+}
+
+•Show Main Prep •file.Lines ⊑•args