--- /dev/null
+Split←{
+ blocknums ← +`𝕨
+ # Set entries in blocknums to -1 when they correspond with delimiters.
+ blocknums ↩ (¯1¨)⌾(𝕨⊸/) blocknums
+ blocknums⊔𝕩
+}
+
+# Material types are ore, clay, obsidian, geode.
+
+# Only the numbers differ between blueprints.
+Prep←{
+ words←(' '=𝕩)Split 𝕩
+ •ParseFloat¨(⋈¨[⟨6, ¯1,¯1,¯1⟩,
+ ⟨12,¯1,¯1,¯1⟩,
+ ⟨18,21,¯1,¯1⟩,
+ ⟨27,¯1,30,¯1⟩])⊑words∾⟨"0"⟩
+}¨
+
+# 0÷0 is NaN. But for our purposes we want it to be 0.
+NtZ←{=˜𝕩 ? 𝕩; 0}¨ # NaN is not equal to itself.
+
+EvalBlueprint←{𝕊 robot_costs:
+ •Show robot_costs
+ •Show max_costs←⌈˝(robot_costs∾[⟨0,0,0,∞⟩]) # Want all the geodes.
+ Search←{ 𝕊⟨time,stock,robots⟩:
+ #•Show ⟨time,stock,robots⟩
+ result←⌈´{
+ needed←(𝕩⊏robot_costs)-stock
+ needed_time←1+0⌈⌈´⌈NtZ needed÷robots
+ # Build a robot if there's time and we might need it.
+ (needed_time≤time)∧(𝕩⊑(stock+robots×time)<max_costs×time) ?
+ Search ⟨time-needed_time
+ (stock+robots×needed_time)-𝕩⊏robot_costs
+ (1⊸+)⌾(𝕩⊸⊑)robots⟩;
+ ¯∞ # No time to built this kind of robot.
+ }¨↕≠robot_costs
+ result≥0 ? result; # Return if any robot can be built.
+ 𝕊⟨time,stock,robots⟩:
+ 3⊑stock+robots×time # If not, return number of geodes we can get in time.
+ }
+ •Show Search ⟨32,⟨0,0,0,0⟩,⟨1,0,0,0⟩⟩
+}
+
+Main←{
+ ×´EvalBlueprint¨3↑𝕩
+}
+
+•Show Main Prep •file.Lines ⊑•args