chiark / gitweb /
Genericise Split to modifier _split in 04
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 4 May 2024 08:49:13 +0000 (09:49 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Sat, 4 May 2024 08:49:13 +0000 (09:49 +0100)
04/04a.bqn
04/04b.bqn

index 5f249850843d826938f1d5f5404b54d3980cd28c..4e378b4e9f6ca0502fe801dc87aba15e0a8ef4d3 100644 (file)
@@ -1,12 +1,12 @@
-Split←{
-  delimsâ\86\90ð\9d\95©â\88\8a",-"
+_split←{
+  delimsâ\86\90ð\9d\94½ð\9d\95©
   blocknums ← +`delims
   # Set entries in blocknums to -1 when they correspond with delims.
   blocknums ↩ (¯1¨)⌾(delims⊸/) blocknums
   blocknums⊔𝕩
 }
 
-Prep←{⍉>•ParseFloat¨¨Split¨𝕩}
+Prep←{⍉>•ParseFloat¨¨{𝕩∊",-"}_split¨𝕩}
 
 Main←{𝕊[x0,x1,y0,y1]:
   +´((x0≤y0)∧(x1≥y1))∨((y0≤x0)∧(y1≥x1))
index 8832e63d555119cdbc2e2f9cd9860f0aa6a7a80f..048a6dc07028c54b6953ed34127ae3288e3ca70f 100644 (file)
@@ -1,12 +1,12 @@
-Split←{
-  delimsâ\86\90ð\9d\95©â\88\8a",-"
+_split←{
+  delimsâ\86\90ð\9d\94½ð\9d\95©
   blocknums ← +`delims
   # Set entries in blocknums to -1 when they correspond with delims.
   blocknums ↩ (¯1¨)⌾(delims⊸/) blocknums
   blocknums⊔𝕩
 }
 
-Prep←{⍉>•ParseFloat¨¨Split¨𝕩}
+Prep←{⍉>•ParseFloat¨¨{𝕩∊",-"}_split¨𝕩}
 
 Main←{𝕊[x0,x1,y0,y1]:
   +´((x0≤y1)∧(x1≥y0))∨((y0≤x1)∧(y1≥x0))