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:
223e3d5
)
04a done
author
Ben Harris
<bjh21@bjh21.me.uk>
Sat, 4 May 2024 08:39:02 +0000
(09:39 +0100)
committer
Ben Harris
<bjh21@bjh21.me.uk>
Sat, 4 May 2024 08:39:02 +0000
(09:39 +0100)
04/04a.bqn
[new file with mode: 0644]
patch
|
blob
diff --git a/04/04a.bqn
b/04/04a.bqn
new file mode 100644
(file)
index 0000000..
5f24985
--- /dev/null
+++ b/
04/04a.bqn
@@ -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