--- /dev/null
+# Material types are ore, clay, obsidian, geode.
+
+# Initially just handle the first blueprint.
+
+robot_costs ← [⟨4,0,0,0⟩,⟨2,0,0,0⟩,⟨3,14,0,0⟩,⟨2,0,7,0⟩]
+
+Search←{
+ 𝕊⟨·,stock,·⟩: ∨´0>stock ? ¯∞; # Bankruptcy is undesirable.
+ 𝕊⟨0,stock,·⟩: 3⊑stock;
+ 𝕊⟨time,stock,robots⟩:
+ •Show ⟨time,stock,robots⟩
+ ⌈´Search¨⟨⟨time-1,stock+robots,robots⟩⟩∾{
+ ⟨time-1,stock+robots-𝕩⊏robot_costs,(1⊸+)⌾(𝕩⊸⊑)robots⟩}¨↕≠robot_costs
+}
+
+•Show Search ⟨5,⟨0,0,0,0⟩,⟨1,0,0,0⟩⟩