chiark / gitweb /
03a just needs priority
authorBen Harris <bjh21@bjh21.me.uk>
Fri, 3 May 2024 08:22:56 +0000 (09:22 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Fri, 3 May 2024 08:22:56 +0000 (09:22 +0100)
03/03a.bqn [new file with mode: 0644]

diff --git a/03/03a.bqn b/03/03a.bqn
new file mode 100644 (file)
index 0000000..3527dac
--- /dev/null
@@ -0,0 +1,9 @@
+Split←{⟨2,∘⟩⥊𝕩}         # Split rucksack into compartments.
+Intersect←{(𝕨∊𝕩)/𝕨}     # Find elements of 𝕨 that are in 𝕩.
+Priority←{1+𝕩-'a'}      # XXX Get priority of an item.
+
+Process1←{Priority⊑Intersect˝Split𝕩}
+
+Main←Process1¨
+
+•Show Main •file.Lines ⊑•args