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

diff --git a/04/04a.bqn b/04/04a.bqn
new file mode 100644 (file)
index 0000000..5f24985
--- /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≤y0)∧(x1≥y1))∨((y0≤x0)∧(y1≥x1))
+}
+
+•Show Main Prep •file.Lines ⊑•args