From 59126e72075b52045a8d4ce79e96ef4f621eef01 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 15 May 2024 11:34:46 +0100 Subject: [PATCH] 15a: input parsing --- 15/15a.bqn | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 15/15a.bqn diff --git a/15/15a.bqn b/15/15a.bqn new file mode 100644 index 0000000..b794dfe --- /dev/null +++ b/15/15a.bqn @@ -0,0 +1,15 @@ +Split←{ + blocknums ← +`𝕨 + # Set entries in blocknums to -1 when they correspond with delimiters. + blocknums ↩ (¯1¨)⌾(𝕨⊸/) blocknums + blocknums⊔𝕩 +} + +Prep←{ + words←' '⊸=⊸Split 𝕩 + ⟨sx,sy,bx⟩←2↓¨¯1↓¨⟨2,3,8⟩⊏words + by←2↓9⊑words + •ParseFloat¨⟨sx,sy,bx,by⟩ +} + +•Show Prep¨ •file.Lines ⊑•args -- 2.30.2