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

diff --git a/10/10a.bqn b/10/10a.bqn
new file mode 100644 (file)
index 0000000..7df5b70
--- /dev/null
@@ -0,0 +1,20 @@
+Split←{
+  blocknums ← +`𝕨
+  # Set entries in blocknums to -1 when they correspond with delimiters.
+  blocknums ↩ (¯1¨)⌾(𝕨⊸/) blocknums
+  blocknums⊔𝕩
+}
+
+Insn←{
+  𝕊⟨"noop"⟩:⟨0⟩;
+  𝕊⟨"addx",v⟩:⟨0,•ParseFloat v⟩
+}
+Prep←{Insn(' '⊸=⊸Split 𝕩)}
+
+Main←{
+  cn←1+↕⊑≢𝕩
+  xs←1+`𝕩
+  +´cn×xs×20=40|cn
+}
+
+•Show Main »∾Prep¨ •file.Lines ⊑•args