From: Ben Harris Date: Thu, 2 May 2024 09:59:51 +0000 (+0100) Subject: 01b done X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~bjharris/git?a=commitdiff_plain;h=7a0fe6a34d75c71699eabdada29c714f80275964;p=aoc-2022.git 01b done --- diff --git a/01/01b.bqn b/01/01b.bqn new file mode 100644 index 0000000..9f83089 --- /dev/null +++ b/01/01b.bqn @@ -0,0 +1,13 @@ +SplitOnBlankLines←{ + blanks ← ""⊸≡¨𝕩 + blocknums ← +`blanks + # Set entries in blocknums to -1 when they correspond with blanks. + blocknums ↩ (¯1¨)⌾(blanks⊸/) blocknums + blocknums⊔𝕩 +} + +Prep←•ParseFloat¨⌾∾ + +Main←{+´3↑∨+´¨𝕩} + +•Show Main Prep SplitOnBlankLines •file.Lines ⊑•args