Claude Fable 5.1, seed 3

Claude Code · medium reasoning effort

ValidCounts toward the meanGame-time budget used

  • Hay 22m produced, 7.34 points
  • Wood 298m produced, 8.47 points
  • Carrot 81.9m produced, 7.91 points
  • Pumpkin 2.93m produced, 6.47 points
  • Cactus 9.24m produced, 6.97 points
  • Power 35.1k produced, 4.54 points
  • Bone 4.38m produced, 6.64 points
  • Weird substance 34.2m produced, 7.53 points
  • Gold 1.23m produced, 6.09 points
  • Water 217k produced, 5.34 points
  • Fertilizer 9.72k produced, 3.99 points

Produced by the end of the run. Pips: points each resource adds to the score, one per tenfold.

Score · economy-v1
71.30orders of magnitude · model mean 69.17
On seed 3
#3of 8 models
Cost
$14.14API-equivalent estimate
Real time
27m 44swall clock, not scored
timelineeconomy-v1 · sampled every 10 game-seconds

Score and what the agent did, over game time

Ticks under the axis: upgrade purchases.

Data table
Game timeScore
0s0.00
1h 00m26.1
2h 00m40.7
3h 00m49.7
4h 00m61.9
5h 00m67.2
6h 00m71.3
said0s · I'll start by observing the farm and checking the docs and research menu.3m 00s · Harvest loop is running but barely producing hay — checking the farm state to see why.9m 50s · The while loop appears to harvest grass before it regrows (destroying it), while the straight-line program worked. I'll use a long straight-line harvester to ea12m 14s · Got it — `can_harvest()` and `if` are unlocked. Fixing the loop now.13m 34s · Now at ~137 hay. Buying expand + plant and reading their docs in parallel.16m 44s · Have ~183 hay, 53 wood. Buying expand (3x3) + operators now; carrots once wood reaches 50 again.20m 24s · Buying senses (hay 146 now) and reading its tutorial so I can write a position-aware 3x3 program with grass, bushes, and carrots.22m 44s · Buying variables and watering now; reading their tutorials in the same step.25m 26s · Buying speed (cheap at 20 wood) and trees now; reading the trees and functions docs alongside.30m 00s · Buying pumpkins now and reading its docs; expand to 6x6 and speed next once carrots recover.31m 50s · Running the new 6x6 mode-switching program (trees/carrots/grass, with pumpkin rounds when carrots pile up).41m 00s · Buying expand (8x8) and grass level 3, and raising the pumpkin-round carrot threshold so carrots accumulate for the speed upgrade (500 carrots).47m 47s · Speed 4 and trees 2 bought. Next: debug (cheap, unlocks timing path), then wait for 500 carrots for sunflowers.51m 20s · Plan: buy grass 4 (2500 wood); add a sunflower round (power doubles drone speed) to the farm program; lower pumpkin threshold later after lists. Writing the pro54m 20s · Buying lists (500 carrots) and watering 4 (3200 wood); reading lists docs in parallel. After that I'll lower the pumpkin threshold.1h 00m · Pumpkins ~2700, weird substance ~1050. Buying mazes, timing, and utilities, and reading the mazes tutorial.1h 02m · Gold is flowing fast from mazes (+1216 in 90s). Waiting for 2000 gold, then buying megafarm.1h 04m · Megafarm gives 2 drones now (next level: 8000 gold → 4). Rewriting the farm program for multi-drone column workers, with a gold target of 8000.1h 07m · Nothing produced in 3 minutes — something is stuck. Checking the farm state.1h 11m · Working again: +2176 gold, sunflowers replenished power. Buying carrots level 4 (6250 wood) and letting it run.1h 19m · Buying expand (12x12) now; the program sizes itself from `get_world_size()` so it adapts.1h 26m · Gold hit 8000 — buying megafarm level 2 (4 drones) and checking the next costs. Then I'll raise the pumpkin threshold so carrots accumulate for speed 5 and pump1h 26m · Next steps: set PUMP_AT=1200 (accumulate carrots for speed 5 / pumpkins 2), GOLD_AT=40000 (toward 8 drones), then run. Write and run are sequential, so writing 1h 31m · Carrots hit ~2060 — buying speed 5 and pumpkins 2 together now.1h 42m · Maze mode is eating most of the drone time (gold 21k, 8 drones at 32k). Buying trees 3 with spare hay, then waiting for 32k gold.1h 58m · Cactus round worked: +19,944 cactus. Buying dinosaurs (2000) and mazes 2 (12000 cactus, doubles gold per maze), and reading the dinosaur docs.5h 02m · The tail is ~370/484, so the dino round should finish in a few minutes (worth ~1.9M bones). Needed: wait, stopping early once bones jump. Single request.5h 59m · About a minute of game time remains — I'll let it run out with the farm program still producing, then take a final snapshot.5h 59m · The budget is used up (8s left, program still running). Final summary of the run: ## Result **Farm:** 22x22, 32 drones, speed maxed, all core upgrades bought 5h 59m · With 8 seconds left, the most useful thing is to let the farm program keep running to the final tick rather than spend the time on any other action.6h 00m · The budget is fully consumed — 6h elapsed, 0s remaining — and the game reports the run is over. There is nothing further to request: every remaining action woulsaid: 31 entries, first at 0s
thought35m 40s · Hay has crashed to 29 since carrots eat hay, so I'll adjust odd-parity tiles to dynamically pick grass or carrots based on hay stock. I'm also buying fertilizer1h 00m · I'll switch to a maze mode to accumulate gold toward the 2000-gold megafarm, while keeping pumpkin/carrot production going for the level 2 pumpkins, speed, and 1h 07m · Found the issue: the drone got stuck because the previous program was stopped mid-maze, causing the new program's `goto` loop to run endlessly against a hedge w1h 32m · I'll set PUMP_AT to roughly 600 to reflect the higher carrot cost of pumpkins, then rerun before accumulating pumpkins for the cactus (5000) and dictionaries (21h 54m · Planting all 144 tiles with 2 pumpkins each and sorting rows then columns via swap lets me harvest 20,736 cactus in one go. I'll add a parallel cactus-sorting r1h 59m · Apples only cost 2 cactus and hats are ready to use. I'll clear the farm, equip the gray hat at (0,0), fill the farm via a serpentine Hamiltonian path, then swa1h 59m · I'll run the program now, since the next steps depend on seeing its output.2h 03m · I need to check which hat names are valid and the current state—fetching both now since they're independent.2h 04m · The farm filled up with 143 apples eaten, but since Gray Hat isn't unlocked yet, the tail bones weren't collected. I'll write a small program to try the default2h 04m · Collected +20,449 bones. Next I'll fix the farm program to use `Hats.Straw_Hat` and purchase polyculture 2 with bones before rerunning.2h 04m · I'll buy polyculture 2 for 10k bones, restart the farm program, and check the updated research costs — doing all three at once since they're independent.2h 10m · I'll go ahead and get dinosaurs 2 (needs 12k cactus, doubles bone yield) and wait for pumpkins to hit 20k for cactus 2 — these are independent so I'm requesting2h 20m · Mazes consumed the entire 10-minute cycle, netting only +24.8k gold. I'll limit mazes to a small batch per cycle and stop fertilizing cacti, but first I need to2h 20m · I'll update the farm program and buy trees 4 (if hay allows) now, then run the program afterward.2h 21m · I'll run the program now, since everything else depends on its results.2h 31m · The maze logic is dominating every loop since the elif chain keeps re-entering it; I'll fix it so each iteration runs a maze batch when due, then still does a f2h 31m · I'll write the fixed main loop and check the current inventory next, then run it once both are done.2h 31m · Gold's at 75k, but wood and hay stalled since mazes ate up the time. Running the fixed program next—that's the key remaining step.2h 41m · Cactus rounds are dominating gains while pumpkins stall out, so I'll switch the main loop to round-robin between pumpkins, mixed crops, cactus, and dino. I also2h 42m · I'll write the round-robin version now, then run it once it's ready.2h 42m · I'll run the program next, since that's the remaining step needed.2h 52m · Nothing has been produced in 10 minutes, so something seems to be hung. I'll check the farm to see what's happening before deciding on a fix.2h 52m · Found that the drone was stuck in a leftover dinosaur hat state from the interrupted run, causing `goto` to deadlock — fixing this by resetting the hat at progr2h 52m · I'll write the fixed program first, then run it once that's done.2h 53m · I'll run the program now and check back on its progress after it's had some time to execute.2h 58m · Wood's run out since cactus/pump/dino rounds keep wiping trees before they regrow, so I'll switch to mixed sweeps in blocks of 4 and hold off on carrot planting2h 58m · I'll write the updated program now, then run it afterward.2h 58m · I'll run the program now, since the remaining checks depend on its output.3h 08m · Polyculture 20x delivered a massive boost: +177k wood, +54k carrots, +164k bones in 10 minutes. Now I'll spend resources on upgrades (pumpkins, carrots, grass, 3h 09m · I'll buy 4 pumpkins (16k carrots) and 6 waterings (51k wood) now, then let the farm run for about 10 minutes.3h 19m · I'll make a large upgrade purchase (expanding the megafarm's drones and crop types) and check the current state at the same time, since these can run independen3h 19m · I just need to wait for the pumpkin count to hit 64k so the 16x16 expand can proceed — everything else depends on that.3h 29m · I'll request both in parallel: buying carrots, pumpkins, grass, and watering, while also waiting for the 64k pumpkins since they're independent tasks.3h 32m · I'll trigger the 16x16 auto-expand and then let it run for 10 minutes—these two steps don't depend on each other, so I'll request both now.3h 42m · I need to buy grass (8), trees (7), and pumpkins (7), and separately pause the program to raise MAZE_BATCH since unused substance has piled up to ~900k. I'll ru3h 42m · I'll first update the code to use MAZE_BATCH=8, then run it afterward.3h 42m · I'll run the program for about 10 minutes next, then decide on purchases based on what accumulates.3h 53m · I'll purchase cactus 3 (80k pumpkins), dinosaurs 4 (432k cactus), and carrots 8 (3.9M wood), then let the game run for another 10 minutes.4h 03m · Next I'll buy 8 pumpkins, 8 trees, and 9 watering cans (plus attempt 5 polyculture and 4 mazes), then run the simulation for another 10 minutes—I'll request bot4h 13m · I'll buy polyculture 5, mazes 4, and grass 9 now that they're affordable, and also observe to check which mode is running since pumpkins didn't increase this wi4h 14m · I'll let it run for about 10 minutes, since purchases depend on what accumulates over that time.4h 24m · I'll refresh the research costs, try purchasing 9 carrots and 4 cactus, and keep the farm running for another 10 minutes—all at once since these are independent4h 34m · I'll buy 9 carrots now that wood is at ~33M, and separately wait for pumpkins to hit 512k to trigger the 22x22 expansion—both can proceed independently.4h 41m · I'll buy the expand upgrade to 22x22 since we have enough pumpkins (654k ≥ 512k needed), then let it run for 10 minutes.4h 51m · I'll buy 9 pumpkins and 9 trees now that they're affordable, check the farm's current state, and run the simulation for another 10 minutes.5h 02m · I'll check how the snake game is progressing to decide whether to let the current dino round finish or end it early.5h 12m · I'll buy grass 10 (costing ~69M wood) and stop the program to prevent further dino rounds, since a 22x22 round takes ~20 min and could forfeit bones if unfinish5h 13m · Next I'll write the end-game program—no dino, with a cactus/pump/mixed rotation and maze batches—then run it afterward once it's done.5h 13m · Next, I'll run the program, since the remaining checks depend on its output.5h 28m · I'll buy cactus level 4 (720k pumpkins) and megafarm level 5 (512k gold for 32 drones), then run the simulation for another 15 minutes since these purchases are5h 43m · I'll buy 10 carrots (~127M wood) and 5 mazes (cactus), then use up most of the remaining time—requesting both now since they're independent.thought: 51 entries, first at 35m 40s
read10s · docs_list 20s · research 30s · docs_read docs/home.md40s · docs_read docs/first_program.md50s · docs_read unlocks/grass1m 00s · docs_read functions/harvest8m 40s · docs_read docs/scripting/while.md8m 50s · docs_read objects/grass11m 54s · docs_read functions/do_a_flip12m 04s · docs_read docs/unlocks/speed.md13m 44s · docs_read unlocks/expand13m 54s · docs_read unlocks/plant14m 04s · docs_read docs/unlocks/expand_1.md14m 14s · docs_read docs/unlocks/plant.md16m 34s · docs_read objects/bush16m 54s · docs_read unlocks/senses19m 34s · docs_read unlocks/carrots19m 44s · docs_read docs/scripting/operators.md19m 54s · docs_read docs/unlocks/carrots.md20m 34s · docs_read docs/unlocks/senses.md22m 54s · docs_read unlocks/watering23m 04s · docs_read unlocks/trees23m 14s · docs_read docs/unlocks/watering.md23m 24s · docs_read docs/scripting/variables.md23m 54s · docs_read unlocks/pumpkins24m 04s · docs_read unlocks/sunflowers25m 16s · research 25m 36s · docs_read docs/scripting/functions.md26m 16s · docs_read docs/unlocks/trees.md29m 50s · research 30m 10s · docs_read docs/unlocks/pumpkins.md30m 20s · docs_read objects/pumpkin30m 30s · docs_read docs/unlocks/expand_2.md31m 10s · docs_read docs/scripting/for.md35m 10s · docs_read unlocks/fertilizer35m 20s · docs_read unlocks/mazes35m 30s · docs_read unlocks/megafarm36m 00s · docs_read docs/unlocks/fertilizer.md40m 50s · research 50m 50s · docs_read docs/unlocks/sunflowers.md51m 00s · docs_read objects/sunflower51m 10s · research 54m 30s · docs_read docs/scripting/lists.md1h 00m · docs_read docs/unlocks/mazes.md1h 00m · docs_read docs/unlocks/timing.md1h 00m · docs_read functions/can_move1h 03m · docs_read docs/unlocks/megafarm.md1h 03m · docs_read functions/spawn_drone1h 03m · research 1h 16m · docs_read unlocks/polyculture1h 17m · docs_read objects/carrot1h 25m · docs_read docs/unlocks/polyculture.md1h 26m · research 1h 53m · docs_read docs/unlocks/cactus.md1h 54m · docs_read objects/cactus1h 54m · docs_read unlocks/dinosaurs1h 54m · docs_read functions/swap1h 54m · docs_read functions/measure1h 58m · docs_read docs/unlocks/dinosaurs.md1h 58m · docs_read objects/apple1h 59m · docs_read docs/unlocks/hats.md2h 03m · docs_read functions/change_hat2h 10m · research 3h 08m · research 4h 24m · research read: 65 entries, first at 10s
runningrunning: 30 entries, first at 1m 30s
errorserrors: 1 entry, first at 2h 03m

Said: the agent's own progress messages. Thought: its thinking as the agent reported it. Read: docs and research. Wrote: program saves. Running: which program the farm ran. Text sits at the game time it was written; the game is paused while the agent thinks. Dots open the step in the log below.

how-it-playedcompared with Claude Fable 5.1's 3 valid seeds and the 8 models on seed 3

How it played

MeasureThis runModel meanSeed 3 meanWhat it counts
Resources opened11 of 1111 of 119.9 of 11scored resources produced at least once
Study656041docs and research reads
Action overhead12%11%9%game time spent looking, reading and typing (10 s per call)
Tool calls261244198every action the agent took
Program writes292929accepted saves of a program
Program stints302935times a program was started and left running
Median stint5m 00s4m 39s8m 48show long a program usually ran before the next change
Cost per point$0.198$0.209$0.069API-equivalent estimate ÷ score

Farm idle 3% of samples; longest stint 1h 29m; 1 rejected write.

production11 of 11 resources produced

Production and holdings

Each resource on its own scale. Ticks: purchases of the upgrade that feeds it. On the log scale each tenfold rise is one point.

  • Produced (cumulative, what the score counts)
  • Held (after spending)
Vertical scale
Wood298M produced · 8.47 pts
Wood298M produced · 8.47 pts
Carrot81.9M produced · 7.91 pts
Carrot81.9M produced · 7.91 pts
Weird substance34.2M produced · 7.53 pts
Weird substance34.2M produced · 7.53 pts
Hay22M produced · 7.34 pts
Hay22M produced · 7.34 pts
Cactus9.2M produced · 6.97 pts
Cactus9.2M produced · 6.97 pts
Bone4.4M produced · 6.64 pts
Bone4.4M produced · 6.64 pts
Pumpkin2.9M produced · 6.47 pts
Pumpkin2.9M produced · 6.47 pts
Gold1.2M produced · 6.09 pts
Gold1.2M produced · 6.09 pts
Water217.3K produced · 5.34 pts
Water217.3K produced · 5.34 pts
Power35.1K produced · 4.54 pts
Power35.1K produced · 4.54 pts
Fertilizer9.7K produced · 3.99 pts
Fertilizer9.7K produced · 3.99 pts
upgrades104 levels across 27 upgrades

Upgrade timeline

loopsloops: 1 entry, first at 2m 00s
speedspeed: 5 entries, first at 2m 00s
expandexpand: 8 entries, first at 13m 44s
plantplant: 1 entry, first at 13m 44s
operatorsoperators: 1 entry, first at 16m 54s
carrotscarrots: 10 entries, first at 19m 34s
sensessenses: 1 entry, first at 20m 34s
variablesvariables: 1 entry, first at 22m 54s
wateringwatering: 9 entries, first at 22m 54s
functionsfunctions: 2 entries, first at 23m 54s
treestrees: 9 entries, first at 25m 36s
importimport: 1 entry, first at 29m 16s
pumpkinspumpkins: 9 entries, first at 30m 10s
fertilizerfertilizer: 4 entries, first at 36m 00s
grassgrass: 9 entries, first at 40m 50s
debugdebug: 1 entry, first at 47m 57s
sunflowerssunflowers: 1 entry, first at 50m 50s
listslists: 1 entry, first at 54m 30s
mazesmazes: 5 entries, first at 1h 00m
timingtiming: 1 entry, first at 1h 00m
utilitiesutilities: 1 entry, first at 1h 00m
megafarmmegafarm: 5 entries, first at 1h 03m
polyculturepolyculture: 5 entries, first at 1h 25m
cactuscactus: 4 entries, first at 1h 53m
dictionariesdictionaries: 1 entry, first at 1h 53m
dinosaursdinosaurs: 4 entries, first at 1h 58m
hatshats: 4 entries, first at 1h 58m
Every purchase, with what the agent was told
Game timeCallUnlockedResult the agent saw
1m 50s{"upgrades":["loops","speed"]}loops 1, speed 1Bought loops, now level 1. Paid hay 5. Its tutorial is docs page docs/scripting/while.md.
13m 34s{"upgrades":["expand","plant"]}expand 1, plant 1Bought expand, now level 1. Paid hay 30. Its tutorial is docs page docs/unlocks/expand_1.md.
16m 44s{"upgrades":["expand","operators"]}expand 2, operators 1Bought expand, now level 2. Paid wood 20. Its tutorial is docs page docs/unlocks/expand_1.md.
19m 24s{"upgrades":["carrots"]}carrots 1Bought carrots, now level 1. Paid wood 50. Its tutorial is docs page docs/unlocks/carrots.md.
20m 24s{"upgrades":["senses"]}senses 1Bought senses, now level 1. Paid hay 100. Its tutorial is docs page docs/unlocks/senses.md.
22m 44s{"upgrades":["variables","watering"]}variables 1, watering 1Bought variables, now level 1. Paid carrot 35. Its tutorial is docs page docs/scripting/variables.md.
23m 44s{"upgrades":["functions"]}functions 1, functions 1Bought functions, now level 1. Paid carrot 40. Its tutorial is docs page docs/scripting/functions.md.
25m 26s{"upgrades":["speed","trees"]}speed 2, trees 1Bought speed, now level 2. Paid wood 20. Its tutorial is docs page docs/unlocks/speed.md.
26m 26s{"upgrades":["expand"]}expand 3Bought expand, now level 3. Paid wood 30, carrot 20. Its tutorial is docs page docs/unlocks/expand_1.md.
29m 06s{"upgrades":["import","carrots"]}import 1, carrots 2Bought import, now level 1. Paid carrot 80. Its tutorial is docs page docs/scripting/import.md.
30m 00s{"upgrades":["pumpkins"]}pumpkins 1Bought pumpkins, now level 1. Paid wood 500, carrot 200. Its tutorial is docs page docs/unlocks/pumpkins.md.
30m 50s{"upgrades":["expand","speed"]}expand 4, speed 3Bought expand, now level 4. Paid wood 100, carrot 50. Its tutorial is docs page docs/unlocks/expand_1.md.
35m 50s{"upgrades":["fertilizer"]}fertilizer 1Bought fertilizer, now level 1. Paid wood 500. Its tutorial is docs page docs/unlocks/fertilizer.md.
40m 30s{"upgrades":["watering"]}watering 2Bought watering, now level 2. Paid wood 200. Its tutorial is docs page docs/unlocks/watering.md.
40m 40s{"upgrades":["grass","debug","speed"]}grass 2Bought grass, now level 2. Paid hay 300.
41m 00s{"upgrades":["expand","grass"]}expand 5, grass 3Bought expand, now level 5. Paid pumpkin 1000. Its tutorial is docs page docs/unlocks/expand_1.md.
46m 40s{"upgrades":["carrots","fertilizer"]}carrots 3, fertilizer 2Bought carrots, now level 3. Paid wood 1250. Its tutorial is docs page docs/unlocks/carrots.md.
47m 37s{"upgrades":["speed","trees"]}speed 4, trees 2Bought speed, now level 4. Paid carrot 500. Its tutorial is docs page docs/unlocks/speed.md.
47m 47s{"upgrades":["debug"]}debug 1Bought debug, now level 1. Paid hay 50, wood 50. Its tutorial is docs page docs/scripting/debug.md.
50m 40s{"upgrades":["sunflowers","watering"]}sunflowers 1, watering 3Bought sunflowers, now level 1. Paid carrot 500. Its tutorial is docs page docs/unlocks/sunflowers.md.
51m 20s{"upgrades":["grass"]}grass 4Bought grass, now level 4. Paid wood 2500.
54m 20s{"upgrades":["lists","watering"]}lists 1, watering 4Bought lists, now level 1. Paid carrot 500. Its tutorial is docs page docs/scripting/lists.md.
1h 00m{"upgrades":["mazes","timing","utilities"]}mazes 1, timing 1, utilities 1Bought mazes, now level 1. Paid weird_substance 1000. Its tutorial is docs page docs/unlocks/mazes.md.
1h 03m{"upgrades":["megafarm"]}megafarm 1Bought megafarm, now level 1. Paid gold 2000. Its tutorial is docs page docs/unlocks/megafarm.md.
1h 11m{"upgrades":["carrots"]}carrots 4Bought carrots, now level 4. Paid wood 6250. Its tutorial is docs page docs/unlocks/carrots.md.
1h 19m{"upgrades":["expand"]}expand 6Bought expand, now level 6. Paid pumpkin 8000. Its tutorial is docs page docs/unlocks/expand_1.md.
1h 25m{"upgrades":["polyculture"]}polyculture 1Bought polyculture, now level 1. Paid pumpkin 3000. Its tutorial is docs page docs/unlocks/polyculture.md.
1h 26m{"upgrades":["megafarm"]}megafarm 2Bought megafarm, now level 2. Paid gold 8000. Its tutorial is docs page docs/unlocks/megafarm.md.
1h 31m{"upgrades":["speed","pumpkins"]}speed 5, pumpkins 2Bought speed, now level 5. Paid carrot 1000. Its tutorial is docs page docs/unlocks/speed.md.
1h 42m{"upgrades":["trees"]}trees 3Bought trees, now level 3. Paid hay 1200. Its tutorial is docs page docs/unlocks/trees.md.
1h 53m{"upgrades":["megafarm","cactus","dictionaries","grass"]}megafarm 3, cactus 1, dictionaries 1, grass 5Bought megafarm, now level 3. Paid gold 32000. Its tutorial is docs page docs/unlocks/megafarm.md.
1h 58m{"upgrades":["dinosaurs","mazes"]}dinosaurs 1, hats 1, mazes 2Bought dinosaurs, now level 1. Paid cactus 2000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
1h 58m{"upgrades":["hats"]}—Could not buy hats: Already at maximum level.
2h 04m{"upgrades":["polyculture"]}polyculture 2Bought polyculture, now level 2. Paid bone 10000. Its tutorial is docs page docs/unlocks/polyculture.md.
2h 10m{"upgrades":["dinosaurs"]}dinosaurs 2, hats 1Bought dinosaurs, now level 2. Paid cactus 12000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
2h 20m{"upgrades":["trees"]}—Could not buy trees: Not enough resources.
2h 41m{"upgrades":["trees","dinosaurs","mazes","polyculture"]}trees 4, dinosaurs 3, hats 1, mazes 3, polyculture 3Bought trees, now level 4. Paid hay 4800. Its tutorial is docs page docs/unlocks/trees.md.
3h 08m{"upgrades":["pumpkins","carrots","grass","fertilizer","watering","trees","polyculture","megafarm"]}pumpkins 3, carrots 5, grass 6, fertilizer 3, watering 5, trees 5Bought pumpkins, now level 3. Paid carrot 4000. Its tutorial is docs page docs/unlocks/pumpkins.md.
3h 09m{"upgrades":["pumpkins","watering"]}pumpkins 4, watering 6Bought pumpkins, now level 4. Paid carrot 16000. Its tutorial is docs page docs/unlocks/pumpkins.md.
3h 19m{"upgrades":["megafarm","polyculture","carrots","grass","trees","pumpkins","cactus","fertilizer","watering"]}megafarm 4, polyculture 4, carrots 6, grass 7, trees 6, pumpkins 5, cactus 2, fertilizer 4, watering 7Bought megafarm, now level 4. Paid gold 128000. Its tutorial is docs page docs/unlocks/megafarm.md.
3h 29m{"upgrades":["carrots","pumpkins","grass","watering"]}carrots 7, pumpkins 6, watering 8Bought carrots, now level 7. Paid wood 781000. Its tutorial is docs page docs/unlocks/carrots.md.
3h 32m{"upgrades":["expand"]}expand 7Bought expand, now level 7. Paid pumpkin 64000. Its tutorial is docs page docs/unlocks/expand_1.md.
3h 42m{"upgrades":["grass","trees","pumpkins"]}grass 8, trees 7, pumpkins 7Bought grass, now level 8. Paid wood 1560000.
3h 53m{"upgrades":["cactus","dinosaurs","carrots"]}cactus 3, dinosaurs 4, hats 1, carrots 8Bought cactus, now level 3. Paid pumpkin 120000. Its tutorial is docs page docs/unlocks/cactus.md.
4h 03m{"upgrades":["pumpkins","trees","watering","polyculture","mazes"]}pumpkins 8, trees 8, watering 9Bought pumpkins, now level 8. Paid carrot 4100000. Its tutorial is docs page docs/unlocks/pumpkins.md.
4h 13m{"upgrades":["polyculture","mazes","grass"]}polyculture 5, mazes 4, grass 9Bought polyculture, now level 5. Paid bone 1250000. Its tutorial is docs page docs/unlocks/polyculture.md.
4h 24m{"upgrades":["carrots","cactus"]}—Could not buy carrots: Not enough resources.
4h 34m{"upgrades":["carrots"]}carrots 9Bought carrots, now level 9. Paid wood 19500000. Its tutorial is docs page docs/unlocks/carrots.md.
4h 41m{"upgrades":["expand"]}expand 8Bought expand, now level 8. Paid pumpkin 512000. Its tutorial is docs page docs/unlocks/expand_1.md.
4h 51m{"upgrades":["pumpkins","trees"]}pumpkins 9, trees 9Bought pumpkins, now level 9. Paid carrot 16400000. Its tutorial is docs page docs/unlocks/pumpkins.md.
5h 12m{"upgrades":["grass"]}grass 10Bought grass, now level 10. Paid wood 39100000.
5h 28m{"upgrades":["cactus","megafarm"]}cactus 4, megafarm 5Bought cactus, now level 4. Paid pumpkin 720000. Its tutorial is docs page docs/unlocks/cactus.md.
5h 43m{"upgrades":["carrots","mazes"]}carrots 10, mazes 5Bought carrots, now level 10. Paid wood 97700000. Its tutorial is docs page docs/unlocks/carrots.md.

Programs 30 writes, code as the agent wrote it

h0.py1 write · 1 ran · first at 1m 10s
  1. r11m 10sRanFinal40 lines · ran 20s
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    Write result the agent saw
    Saved h0 (40 lines).
    Game time: 1m 20s elapsed, 5h 58m 40s of budget remaining.
    run_program at 1m 20s for 60s (agent saw)
    Ran h0 for 20s of game time; it finished.
    Inventory change: hay +40.
    Game time: 1m 50s elapsed, 5h 58m 10s of budget remaining.
    Output:
    (none)
loop.py2 writes · 2 ran · first at 2m 00s
  1. r12m 00sRan2 lines · ran 7m 10s
    while True:
        harvest()
    Write result the agent saw
    Saved loop (2 lines).
    Game time: 2m 10s elapsed, 5h 57m 50s of budget remaining.
    run_program at 2m 10s for 40s (agent saw)
    Ran loop for 40s of game time; it is still running.
    Inventory change: hay +1.
    Game time: 3m elapsed, 5h 57m of budget remaining.
    Output:
    (none)
    run_program at 9m 00s for 30s (agent saw)
    Ran loop for 30s of game time; it is still running.
    Inventory change: hay +1.
    Game time: 9m 40s elapsed, 5h 50m 20s of budget remaining.
    Output:
    (none)
  2. r212m 14sRan3 lines · +2 −1 · ran 2m 30s
    while True:
        if can_harvest():
            harvest()
    Changes from the previous revision
      while True:
    -     harvest()
    +     if can_harvest():
    +         harvest()
    
    Write result the agent saw
    Saved loop (3 lines).
    Game time: 12m 24s elapsed, 5h 47m 36s of budget remaining.
    run_program at 12m 24s for 60s (agent saw)
    Ran loop for 1m of game time; it is still running.
    Inventory change: hay +120.
    Game time: 13m 34s elapsed, 5h 46m 26s of budget remaining.
    Output:
    (none)
h1.py1 write · 1 ran · first at 9m 50s
  1. r19m 50sRanFinal313 lines · ran 1m 44s
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    Write result the agent saw
    Saved h1 (313 lines).
    Game time: 10m elapsed, 5h 50m of budget remaining.
    run_program at 10m 00s for 200s (agent saw)
    Ran h1 for 1m 44s of game time; it finished.
    Inventory change: no change.
    Game time: 11m 54s elapsed, 5h 48m 6s of budget remaining.
    Output:
    (none)
bush.py1 write · 1 ran · first at 14m 44s
  1. r114m 44sRan5 lines · ran 2m 20s
    while True:
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
    Write result the agent saw
    Saved bush (5 lines).
    Game time: 14m 54s elapsed, 5h 45m 6s of budget remaining.
    run_program at 14m 54s for 90s (agent saw)
    Ran bush for 1m 30s of game time; it is still running.
    Inventory change: hay +7, wood +53.
    Game time: 16m 34s elapsed, 5h 43m 26s of budget remaining.
    Output:
    (none)
bush3.py1 write · 1 ran · first at 17m 04s
  1. r117m 04sRan39 lines · ran 3m 50s
    while True:
        if can_harvest():
            harvest()
        move(North)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        move(East)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        move(East)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        if can_harvest():
            harvest()
            plant(Entities.Bush)
        move(North)
        move(East)
    Write result the agent saw
    Saved bush3 (39 lines).
    Game time: 17m 14s elapsed, 5h 42m 46s of budget remaining.
    run_program at 17m 14s for 120s (agent saw)
    Ran bush3 for 2m of game time; it is still running.
    Inventory change: hay +37, wood +106.
    Game time: 19m 24s elapsed, 5h 40m 36s of budget remaining.
    Output:
    (none)
farm3.py1 write · 1 ran · first at 20m 54s
  1. r120m 54sRan19 lines · ran 5m 42s
    while True:
        if get_pos_x() == 2:
            if get_ground_type() != Grounds.Soil:
                till()
            if can_harvest():
                harvest()
            if get_entity_type() != Entities.Carrot:
                plant(Entities.Carrot)
        if get_pos_x() == 1:
            if can_harvest():
                harvest()
            if get_entity_type() != Entities.Bush:
                plant(Entities.Bush)
        if get_pos_x() == 0:
            if can_harvest():
                harvest()
        move(North)
        if get_pos_y() == 0:
            move(East)
    Write result the agent saw
    Saved farm3 (19 lines).
    Game time: 21m 4s elapsed, 5h 38m 56s of budget remaining.
    run_program at 21m 04s for 90s (agent saw)
    Ran farm3 for 1m 30s of game time; it is still running.
    Inventory change: carrot +39, hay +46, wood +16.
    Game time: 22m 44s elapsed, 5h 37m 16s of budget remaining.
    Output:
    (none)
farm.py22 writes · 21 ran · first at 26m 36s
  1. r126m 36sRan26 lines · ran 4m 44s
    def work():
        x = get_pos_x()
        y = get_pos_y()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            want = Entities.Carrot
            if x == 0:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass and get_entity_type() != want:
            plant(want)
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    while True:
        work()
        move(North)
        if get_pos_y() == 0:
            move(East)
    Write result the agent saw
    Saved farm (26 lines).
    Game time: 26m 46s elapsed, 5h 33m 14s of budget remaining.
    run_program at 26m 46s for 120s (agent saw)
    Ran farm for 2m of game time; it is still running.
    Inventory change: carrot +129, hay -10, water -24, wood +529.
    Game time: 28m 56s elapsed, 5h 31m 4s of budget remaining.
    Output:
    (none)
  2. —31m 20sRejected
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            want = Entities.Carrot
            if x == 0:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    while True:
        if num_items(Items.Carrot) >= 120:
            pump_round()
        else:
            mixed_sweep()
    Write result the agent saw
    Stop the program before editing it.
  3. r231m 40sRan68 lines · +51 −9 · ran 3m 50s
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            want = Entities.Carrot
            if x == 0:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    while True:
        if num_items(Items.Carrot) >= 120:
            pump_round()
        else:
            mixed_sweep()
    Changes from the previous revision
    - def work():
    + def water():
    +     if get_water() < 0.5 and num_items(Items.Water) > 0:
    +         use_item(Items.Water)
    + 
    + def ensure(want):
    +     e = get_entity_type()
    +     if e == want:
    +         return
    +     if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
    +         harvest()
    +     plant(want)
    + 
    + def mixed_tile():
          x = get_pos_x()
          y = get_pos_y()
          if can_harvest():
              harvest()
    -     if want != Entities.Grass and get_entity_type() != want:
    -         plant(want)
    -     if get_water() < 0.5 and num_items(Items.Water) > 0:
    -         use_item(Items.Water)
    +     if want != Entities.Grass:
    +         ensure(want)
    +     water()
      
    - while True:
    -     work()
    -     move(North)
    -     if get_pos_y() == 0:
    + def mixed_sweep():
    +     n = get_world_size()
    +     for i in range(n):
    +         for j in range(n):
    +             mixed_tile()
    +             move(North)
              move(East)
    + 
    + def pump_round():
    +     n = get_world_size()
    +     done = False
    +     while not done:
    +         done = True
    +         for i in range(n):
    +             for j in range(n):
    +                 if get_ground_type() != Grounds.Soil:
    +                     till()
    +                 e = get_entity_type()
    +                 if e != Entities.Pumpkin:
    +                     ensure(Entities.Pumpkin)
    +                     done = False
    +                 else:
    +                     if not can_harvest():
    +                         done = False
    +                 water()
    +                 move(North)
    +             move(East)
    +         if num_items(Items.Carrot) < 2:
    +             return
    +     harvest()
    + 
    + while True:
    +     if num_items(Items.Carrot) >= 120:
    +         pump_round()
    +     else:
    +         mixed_sweep()
    
    Write result the agent saw
    Saved farm (68 lines).
    Game time: 31m 50s elapsed, 5h 28m 10s of budget remaining.
    run_program at 31m 50s for 180s (agent saw)
    Ran farm for 3m of game time; it is still running.
    Inventory change: carrot -40, hay -55, pumpkin +864, water -2, wood +68.
    Game time: 35m elapsed, 5h 25m of budget remaining.
    Output:
    (none)
  4. r336m 10sRan77 lines · +10 −1 · ran 4m 50s
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < 300:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    while True:
        if num_items(Items.Carrot) >= 120:
            pump_round()
        else:
            mixed_sweep()
    Changes from the previous revision
              use_item(Items.Water)
      
    + def fert():
    +     if num_items(Items.Fertilizer) > 0:
    +         use_item(Items.Fertilizer)
    + 
      def ensure(want):
          e = get_entity_type()
              harvest()
          plant(want)
    +     fert()
      
      def mixed_tile():
          x = get_pos_x()
          y = get_pos_y()
    +     e = get_entity_type()
          want = Entities.Tree
          if (x + y) % 2 == 1:
    +         if e == Entities.Carrot and not can_harvest():
    +             water()
    +             return
              want = Entities.Carrot
    -         if x == 0:
    +         if num_items(Items.Hay) < 300:
                  want = Entities.Grass
          if want == Entities.Carrot:
    
    Write result the agent saw
    Saved farm (77 lines).
    Game time: 36m 20s elapsed, 5h 23m 40s of budget remaining.
    run_program at 36m 20s for 240s (agent saw)
    Ran farm for 4m of game time; it is still running.
    Inventory change: carrot -90, fertilizer -2, hay +298, pumpkin +627, water -4, weird_substance +93, wood +1428.
    Game time: 40m 30s elapsed, 5h 19m 30s of budget remaining.
    Output:
    (none)
  5. r441m 20sRan80 lines · +5 −2 · ran 10m 00s
    PUMP_AT = 600
    HAY_AT = 400
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    while True:
        if num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            mixed_sweep()
    Changes from the previous revision
    + PUMP_AT = 600
    + HAY_AT = 400
    + 
      def water():
          if get_water() < 0.5 and num_items(Items.Water) > 0:
                  return
              want = Entities.Carrot
    -         if num_items(Items.Hay) < 300:
    +         if num_items(Items.Hay) < HAY_AT:
                  want = Entities.Grass
          if want == Entities.Carrot:
      
      while True:
    -     if num_items(Items.Carrot) >= 120:
    +     if num_items(Items.Carrot) >= PUMP_AT:
              pump_round()
          else:
    
    Write result the agent saw
    Saved farm (80 lines).
    Game time: 41m 30s elapsed, 5h 18m 30s of budget remaining.
    run_program at 41m 30s for 300s (agent saw)
    Ran farm for 5m of game time; it is still running.
    Inventory change: carrot +293, fertilizer -2, hay +210, water -4, weird_substance +71, wood +2473.
    Game time: 46m 40s elapsed, 5h 13m 20s of budget remaining.
    Output:
    (none)
  6. r551m 40sRan115 lines · +36 −1 · ran 2m 50s
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 200
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    def sun_round():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                if get_ground_type() != Grounds.Soil:
                    till()
                ensure(Entities.Sunflower)
                water()
                move(North)
            move(East)
        remaining = n * n
        while remaining > 10:
            best = 0
            for i in range(n):
                for j in range(n):
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m > best:
                            best = m
                    move(North)
                move(East)
            for i in range(n):
                for j in range(n):
                    if remaining > 10 and get_entity_type() == Entities.Sunflower:
                        if measure() == best:
                            if can_harvest():
                                harvest()
                                remaining -= 1
                    water()
                    move(North)
                move(East)
    
    while True:
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            mixed_sweep()
    Changes from the previous revision
      PUMP_AT = 600
      HAY_AT = 400
    + SUN_AT = 200
      
      def water():
          harvest()
      
    + def sun_round():
    +     n = get_world_size()
    +     for i in range(n):
    +         for j in range(n):
    +             if get_ground_type() != Grounds.Soil:
    +                 till()
    +             ensure(Entities.Sunflower)
    +             water()
    +             move(North)
    +         move(East)
    +     remaining = n * n
    +     while remaining > 10:
    +         best = 0
    +         for i in range(n):
    +             for j in range(n):
    +                 if get_entity_type() == Entities.Sunflower:
    +                     m = measure()
    +                     if m > best:
    +                         best = m
    +                 move(North)
    +             move(East)
    +         for i in range(n):
    +             for j in range(n):
    +                 if remaining > 10 and get_entity_type() == Entities.Sunflower:
    +                     if measure() == best:
    +                         if can_harvest():
    +                             harvest()
    +                             remaining -= 1
    +                 water()
    +                 move(North)
    +             move(East)
    + 
      while True:
    -     if num_items(Items.Carrot) >= PUMP_AT:
    +     if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
    +         sun_round()
    +     elif num_items(Items.Carrot) >= PUMP_AT:
              pump_round()
          else:
    
    Write result the agent saw
    Saved farm (115 lines).
    Game time: 51m 50s elapsed, 5h 8m 10s of budget remaining.
    run_program at 51m 50s for 120s (agent saw)
    Ran farm for 2m of game time; it is still running.
    Inventory change: carrot +98, fertilizer -4, power +348.81, water -8, weird_substance +171, wood +929.
    Game time: 54m elapsed, 5h 6m of budget remaining.
    Output:
    (none)
  7. r654m 50sRan115 lines · +1 −1 · ran 5m 40s
    PUMP_AT = 250
    HAY_AT = 400
    SUN_AT = 200
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    def sun_round():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                if get_ground_type() != Grounds.Soil:
                    till()
                ensure(Entities.Sunflower)
                water()
                move(North)
            move(East)
        remaining = n * n
        while remaining > 10:
            best = 0
            for i in range(n):
                for j in range(n):
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m > best:
                            best = m
                    move(North)
                move(East)
            for i in range(n):
                for j in range(n):
                    if remaining > 10 and get_entity_type() == Entities.Sunflower:
                        if measure() == best:
                            if can_harvest():
                                harvest()
                                remaining -= 1
                    water()
                    move(North)
                move(East)
    
    while True:
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            mixed_sweep()
    Changes from the previous revision
    - PUMP_AT = 600
    + PUMP_AT = 250
      HAY_AT = 400
      SUN_AT = 200
    
    Write result the agent saw
    Saved farm (115 lines).
    Game time: 55m elapsed, 5h 5m of budget remaining.
    run_program at 55m 00s for 300s (agent saw)
    Ran farm for 5m of game time; it is still running.
    Inventory change: carrot +134, fertilizer -4, hay +28, power +218.54, pumpkin +2244, water -16, weird_substance +330, wood +2834.
    Game time: 1h 10s elapsed, 4h 59m 50s of budget remaining.
    Output:
    (none)
  8. r71h 01mRan154 lines · +40 −1 · ran 2m 54s
    PUMP_AT = 250
    HAY_AT = 400
    SUN_AT = 200
    GOLD_AT = 2000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def mixed_sweep():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                mixed_tile()
                move(North)
            move(East)
    
    def pump_round():
        n = get_world_size()
        done = False
        while not done:
            done = True
            for i in range(n):
                for j in range(n):
                    if get_ground_type() != Grounds.Soil:
                        till()
                    e = get_entity_type()
                    if e != Entities.Pumpkin:
                        ensure(Entities.Pumpkin)
                        done = False
                    else:
                        if not can_harvest():
                            done = False
                    water()
                    move(North)
                move(East)
            if num_items(Items.Carrot) < 2:
                return
        harvest()
    
    def sun_round():
        n = get_world_size()
        for i in range(n):
            for j in range(n):
                if get_ground_type() != Grounds.Soil:
                    till()
                ensure(Entities.Sunflower)
                water()
                move(North)
            move(East)
        remaining = n * n
        while remaining > 10:
            best = 0
            for i in range(n):
                for j in range(n):
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m > best:
                            best = m
                    move(North)
                move(East)
            for i in range(n):
                for j in range(n):
                    if remaining > 10 and get_entity_type() == Entities.Sunflower:
                        if measure() == best:
                            if can_harvest():
                                harvest()
                                remaining -= 1
                    water()
                    move(North)
                move(East)
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 2000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    while True:
        if num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
            while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            mixed_sweep()
    Changes from the previous revision
      HAY_AT = 400
      SUN_AT = 200
    + GOLD_AT = 2000
      
      def water():
                  move(East)
      
    + def maze_round():
    +     n = get_world_size()
    +     amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
    +     if num_items(Items.Weird_Substance) < amount:
    +         return False
    +     if get_entity_type() != Entities.Bush:
    +         if get_entity_type() != None:
    +             harvest()
    +         plant(Entities.Bush)
    +     use_item(Items.Weird_Substance, amount)
    +     dirs = [North, East, South, West]
    +     d = 0
    +     steps = 0
    +     while get_entity_type() != Entities.Treasure and steps < 2000:
    +         steps += 1
    +         r = (d + 1) % 4
    +         l = (d + 3) % 4
    +         if can_move(dirs[r]):
    +             d = r
    +             move(dirs[d])
    +         elif can_move(dirs[d]):
    +             move(dirs[d])
    +         elif can_move(dirs[l]):
    +             d = l
    +             move(dirs[d])
    +         else:
    +             d = (d + 2) % 4
    +             move(dirs[d])
    +     if get_entity_type() == Entities.Treasure:
    +         harvest()
    +         return True
    +     harvest()
    +     return False
    + 
      while True:
    -     if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
    +     if num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
    +         while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
    +             if not maze_round():
    +                 break
    +     elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
              sun_round()
          elif num_items(Items.Carrot) >= PUMP_AT:
    
    Write result the agent saw
    Saved farm (154 lines).
    Game time: 1h 1m 10s elapsed, 4h 58m 50s of budget remaining.
    run_program at 1h 01m for 90s (agent saw)
    Ran farm for 1m 30s of game time; it is still running.
    Inventory change: carrot +220, fertilizer -2, gold +1216, hay +328, power -60.68, water -10, weird_substance -13, wood +327.
    Game time: 1h 2m 50s elapsed, 4h 57m 10s of budget remaining.
    Output:
    (none)
  9. r81h 04mRan204 lines · +105 −55 · ran 3m 30s
    PUMP_AT = 250
    HAY_AT = 400
    SUN_AT = 200
    GOLD_AT = 8000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            move(East)
        while get_pos_y() != y:
            move(North)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 2000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    while True:
        if num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
            while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      HAY_AT = 400
      SUN_AT = 200
    - GOLD_AT = 2000
    + GOLD_AT = 8000
      
      def water():
          fert()
      
    + def goto(x, y):
    +     while get_pos_x() != x:
    +         move(East)
    +     while get_pos_y() != y:
    +         move(North)
    + 
      def mixed_tile():
          x = get_pos_x()
          water()
      
    - def mixed_sweep():
    + def pump_tile():
    +     if get_ground_type() != Grounds.Soil:
    +         till()
    +     e = get_entity_type()
    +     if e != Entities.Pumpkin:
    +         ensure(Entities.Pumpkin)
    +         water()
    +         return False
    +     water()
    +     return can_harvest()
    + 
    + def sun_plant_tile():
    +     if get_ground_type() != Grounds.Soil:
    +         till()
    +     ensure(Entities.Sunflower)
    +     water()
    +     if get_entity_type() == Entities.Sunflower:
    +         return measure()
    +     return 0
    + 
    + def worker(mode, k, D, best, cap):
          n = get_world_size()
    -     for i in range(n):
    +     if mode == 1:
    +         done = False
    +         while not done:
    +             done = True
    +             x = k
    +             while x < n:
    +                 goto(x, 0)
    +                 for j in range(n):
    +                     if not pump_tile():
    +                         done = False
    +                     move(North)
    +                 x += D
    +             if num_items(Items.Carrot) < 2:
    +                 return 0
    +         return 0
    +     res = 0
    +     newbest = 0
    +     x = k
    +     while x < n:
    +         goto(x, 0)
              for j in range(n):
    -             mixed_tile()
    +             if mode == 0:
    +                 mixed_tile()
    +             elif mode == 2:
    +                 m = sun_plant_tile()
    +                 if m != None and m > res:
    +                     res = m
    +             elif mode == 3:
    +                 if get_entity_type() == Entities.Sunflower:
    +                     m = measure()
    +                     if m == best and res < cap and can_harvest():
    +                         harvest()
    +                         res += 1
    +                     else:
    +                         if m > newbest:
    +                             newbest = m
    +                 water()
                  move(North)
    -         move(East)
    +         x += D
    +     if mode == 3:
    +         return [res, newbest]
    +     return res
      
    + def run_all(mode, best, cap):
    +     D = max_drones()
    +     handles = []
    +     failed = []
    +     for k in range(1, D):
    +         h = spawn_drone(worker, mode, k, D, best, cap)
    +         if h == None:
    +             failed.append(k)
    +         else:
    +             handles.append(h)
    +     results = [worker(mode, 0, D, best, cap)]
    +     for k in failed:
    +         results.append(worker(mode, k, D, best, cap))
    +     for h in handles:
    +         results.append(wait_for(h))
    +     return results
    + 
      def pump_round():
    -     n = get_world_size()
    -     done = False
    -     while not done:
    -         done = True
    -         for i in range(n):
    -             for j in range(n):
    -                 if get_ground_type() != Grounds.Soil:
    -                     till()
    -                 e = get_entity_type()
    -                 if e != Entities.Pumpkin:
    -                     ensure(Entities.Pumpkin)
    -                     done = False
    -                 else:
    -                     if not can_harvest():
    -                         done = False
    -                 water()
    -                 move(North)
    -             move(East)
    -         if num_items(Items.Carrot) < 2:
    -             return
    -     harvest()
    +     run_all(1, 0, 0)
    +     if get_entity_type() == Entities.Pumpkin and can_harvest():
    +         harvest()
      
      def sun_round():
          n = get_world_size()
    -     for i in range(n):
    -         for j in range(n):
    -             if get_ground_type() != Grounds.Soil:
    -                 till()
    -             ensure(Entities.Sunflower)
    -             water()
    -             move(North)
    -         move(East)
    +     rs = run_all(2, 0, 0)
    +     best = 0
    +     for r in rs:
    +         best = max(best, r)
          remaining = n * n
    -     while remaining > 10:
    -         best = 0
    -         for i in range(n):
    -             for j in range(n):
    -                 if get_entity_type() == Entities.Sunflower:
    -                     m = measure()
    -                     if m > best:
    -                         best = m
    -                 move(North)
    -             move(East)
    -         for i in range(n):
    -             for j in range(n):
    -                 if remaining > 10 and get_entity_type() == Entities.Sunflower:
    -                     if measure() == best:
    -                         if can_harvest():
    -                             harvest()
    -                             remaining -= 1
    -                 water()
    -                 move(North)
    -             move(East)
    +     while remaining > 10 and best > 0:
    +         cap = (remaining - 10) // max_drones() + 1
    +         rs = run_all(3, best, cap)
    +         h = 0
    +         nb = 0
    +         for r in rs:
    +             h += r[0]
    +             nb = max(nb, r[1])
    +         remaining -= h
    +         if h == 0 and nb == 0:
    +             break
    +         best = nb
      
      def maze_round():
              pump_round()
          else:
    -         mixed_sweep()
    +         run_all(0, 0, 0)
    
    Write result the agent saw
    Saved farm (204 lines).
    Game time: 1h 4m 24s elapsed, 4h 55m 36s of budget remaining.
    run_program at 1h 04m for 180s (agent saw)
    Ran farm for 3m of game time; it is still running.
    Inventory change: fertilizer +36, power -242.86, water +144.
    Game time: 1h 7m 34s elapsed, 4h 52m 26s of budget remaining.
    Output:
    (none)
  10. r91h 08mRan212 lines · +22 −14 · ran 18m 07s
    PUMP_AT = 250
    HAY_AT = 400
    SUN_AT = 200
    GOLD_AT = 8000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
            while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      def goto(x, y):
          while get_pos_x() != x:
    -         move(East)
    +         if not move(East):
    +             harvest()
          while get_pos_y() != y:
    -         move(North)
    +         if not move(North):
    +             harvest()
      
      def mixed_tile():
              best = nb
      
    - def maze_round():
    -     n = get_world_size()
    -     amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
    -     if num_items(Items.Weird_Substance) < amount:
    -         return False
    -     if get_entity_type() != Entities.Bush:
    -         if get_entity_type() != None:
    -             harvest()
    -         plant(Entities.Bush)
    -     use_item(Items.Weird_Substance, amount)
    + def solve_maze():
          dirs = [North, East, South, West]
          d = 0
          steps = 0
    -     while get_entity_type() != Entities.Treasure and steps < 2000:
    +     while get_entity_type() != Entities.Treasure and steps < 3000:
              steps += 1
              r = (d + 1) % 4
          return False
      
    + def maze_round():
    +     n = get_world_size()
    +     amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
    +     if num_items(Items.Weird_Substance) < amount:
    +         return False
    +     if get_entity_type() != Entities.Bush:
    +         if get_entity_type() != None:
    +             harvest()
    +         plant(Entities.Bush)
    +     use_item(Items.Weird_Substance, amount)
    +     return solve_maze()
    + 
      while True:
    -     if num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
    +     e = get_entity_type()
    +     if e == Entities.Hedge or e == Entities.Treasure:
    +         solve_maze()
    +     elif num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
              while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
                  if not maze_round():
    
    Write result the agent saw
    Saved farm (212 lines).
    Game time: 1h 8m 14s elapsed, 4h 51m 46s of budget remaining.
    run_program at 1h 08m for 180s (agent saw)
    Ran farm for 3m of game time; it is still running.
    Inventory change: carrot +116, fertilizer -48, gold +2176, hay +192, power +94.04, water -176, weird_substance +107, wood +249.
    Game time: 1h 11m 24s elapsed, 4h 48m 36s of budget remaining.
    Output:
    (none)
  11. r101h 26mRan212 lines · +2 −2 · ran 5m 20s
    PUMP_AT = 1200
    HAY_AT = 400
    SUN_AT = 200
    GOLD_AT = 40000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
            while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
    - PUMP_AT = 250
    + PUMP_AT = 1200
      HAY_AT = 400
      SUN_AT = 200
    - GOLD_AT = 8000
    + GOLD_AT = 40000
      
      def water():
    
    Write result the agent saw
    Saved farm (212 lines).
    Game time: 1h 26m 41s elapsed, 4h 33m 19s of budget remaining.
    run_program at 1h 26m for 300s (agent saw)
    Ran farm for 5m of game time; it is still running.
    Inventory change: carrot +1856, fertilizer +15, gold +4752, hay +720, power -234.38, water +60, weird_substance +265, wood +273.
    Game time: 1h 31m 51s elapsed, 4h 28m 9s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- mixed_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
  12. r111h 32mRan212 lines · +1 −1 · ran 22m 01s
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 200
    GOLD_AT = 40000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
            while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
    - PUMP_AT = 1200
    + PUMP_AT = 600
      HAY_AT = 400
      SUN_AT = 200
    
    Write result the agent saw
    Saved farm (212 lines).
    Game time: 1h 32m 21s elapsed, 4h 27m 39s of budget remaining.
    run_program at 1h 32m for 600s (agent saw)
    Ran farm for 10m of game time; it is still running.
    Inventory change: carrot +1098, fertilizer -14, gold +15552, hay +352, power -684.16, pumpkin +1428, water -60, weird_substance -303, wood +303.
    Game time: 1h 42m 31s elapsed, 4h 17m 29s of budget remaining.
    Output:
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- pump_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- pump_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
  13. r121h 54mRan259 lines · +51 −4 · ran 4m 10s
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 300
    CACT_AT = 2000
    WEIRD_HI = 300
    WEIRD_LO = 100
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Weird_Substance) >= WEIRD_HI:
            while num_items(Items.Weird_Substance) >= WEIRD_LO:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Pumpkin) >= CACT_AT:
            cact_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      PUMP_AT = 600
      HAY_AT = 400
    - SUN_AT = 200
    - GOLD_AT = 40000
    + SUN_AT = 300
    + CACT_AT = 2000
    + WEIRD_HI = 300
    + WEIRD_LO = 100
      
      def water():
          return 0
      
    + def cact_tile():
    +     if get_ground_type() != Grounds.Soil:
    +         till()
    +     ensure(Entities.Cactus)
    +     water()
    + 
    + def sort_line(dirn, n):
    +     for p in range(n - 1):
    +         swapped = False
    +         for q in range(n - 1):
    +             a = measure()
    +             b = measure(dirn)
    +             if a != None and b != None and a > b:
    +                 swap(dirn)
    +                 swapped = True
    +             move(dirn)
    +         move(dirn)
    +         if not swapped:
    +             return
    + 
      def worker(mode, k, D, best, cap):
          n = get_world_size()
                      return 0
              return 0
    +     if mode == 5:
    +         y = k
    +         while y < n:
    +             goto(0, y)
    +             sort_line(East, n)
    +             y += D
    +         return 0
    +     if mode == 6:
    +         x = k
    +         while x < n:
    +             goto(x, 0)
    +             sort_line(North, n)
    +             x += D
    +         return 0
          res = 0
          newbest = 0
                                  newbest = m
                      water()
    +             elif mode == 4:
    +                 cact_tile()
                  move(North)
              x += D
              harvest()
      
    + def cact_round():
    +     run_all(4, 0, 0)
    +     run_all(5, 0, 0)
    +     run_all(6, 0, 0)
    +     if get_entity_type() == Entities.Cactus and can_harvest():
    +         harvest()
    + 
      def sun_round():
          n = get_world_size()
          if e == Entities.Hedge or e == Entities.Treasure:
              solve_maze()
    -     elif num_items(Items.Gold) < GOLD_AT and num_items(Items.Weird_Substance) >= 64:
    -         while num_items(Items.Weird_Substance) >= 16 and num_items(Items.Gold) < GOLD_AT:
    +     elif num_items(Items.Weird_Substance) >= WEIRD_HI:
    +         while num_items(Items.Weird_Substance) >= WEIRD_LO:
                  if not maze_round():
                      break
          elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
              sun_round()
    +     elif num_items(Items.Pumpkin) >= CACT_AT:
    +         cact_round()
          elif num_items(Items.Carrot) >= PUMP_AT:
              pump_round()
    
    Write result the agent saw
    Saved farm (259 lines).
    Game time: 1h 55m 2s elapsed, 4h 4m 58s of budget remaining.
    run_program at 1h 55m for 180s (agent saw)
    Ran farm for 3m of game time; it is still running.
    Inventory change: cactus +19944, fertilizer +25, gold +4896, power -282.14, pumpkin -288, water +102, weird_substance +384.
    Game time: 1h 58m 12s elapsed, 4h 1m 48s of budget remaining.
    Output:
    (none)
  14. r131h 59mRan300 lines · +41 −0 · ran 3m 55s · 1 runtime error
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 300
    CACT_AT = 2000
    WEIRD_HI = 300
    WEIRD_LO = 100
    DINO_CACT = 4000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Gray_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Weird_Substance) >= WEIRD_HI:
            while num_items(Items.Weird_Substance) >= WEIRD_LO:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
            dino_round()
        elif num_items(Items.Pumpkin) >= CACT_AT:
            cact_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      WEIRD_HI = 300
      WEIRD_LO = 100
    + DINO_CACT = 4000
      
      def water():
          water()
      
    + def clear_tile():
    +     if get_entity_type() != None:
    +         harvest()
    +     if get_ground_type() == Grounds.Soil:
    +         till()
    + 
      def sort_line(dirn, n):
          for p in range(n - 1):
                  elif mode == 4:
                      cact_tile()
    +             elif mode == 7:
    +                 clear_tile()
                  move(North)
              x += D
              best = nb
      
    + def dino_dir():
    +     x = get_pos_x()
    +     y = get_pos_y()
    +     n = get_world_size()
    +     if x == 0:
    +         if y == 0:
    +             return East
    +         return South
    +     if y % 2 == 0:
    +         if x < n - 1:
    +             return East
    +         return North
    +     if x > 1:
    +         return West
    +     if y == n - 1:
    +         return West
    +     return North
    + 
    + def dino_round():
    +     run_all(7, 0, 0)
    +     goto(0, 0)
    +     change_hat(Hats.Dinosaur_Hat)
    +     steps = 0
    +     limit = get_world_size() * get_world_size() * 90
    +     while steps < limit:
    +         if not move(dino_dir()):
    +             break
    +         steps += 1
    +     change_hat(Hats.Gray_Hat)
    + 
      def solve_maze():
          dirs = [North, East, South, West]
          elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
              sun_round()
    +     elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
    +         dino_round()
          elif num_items(Items.Pumpkin) >= CACT_AT:
              cact_round()
    
    Write result the agent saw
    Saved farm (300 lines).
    Game time: 1h 59m 32s elapsed, 4h 28s of budget remaining.
    run_program at 1h 59m for 240s (agent saw)
    Ran farm for 3m 55s of game time; it stopped with an error: Hats.Gray_Hat must be unlocked before this can be used.
    Inventory change: cactus -286, carrot -144, fertilizer -7, gold +4032, hay +2224, power +501.46, water -44, weird_substance -100.
    Game time: 2h 3m 37s elapsed, 3h 56m 23s of budget remaining.
    Output:
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Error: Hats.Gray_Hat must be unlocked before this can be used.
    In: dino_round
    change_hat(Hats.Gray_Hat)
              ^^             
    --------------------------------------------------------------------
    Runtime error at 2h 03m (telemetry; not shown to the agent)
    Hats.Gray_Hat must be unlocked before this can be used.
  15. r142h 04mRan300 lines · +1 −1 · ran 15m 40s
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 300
    CACT_AT = 2000
    WEIRD_HI = 300
    WEIRD_LO = 100
    DINO_CACT = 4000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Weird_Substance) >= WEIRD_HI:
            while num_items(Items.Weird_Substance) >= WEIRD_LO:
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
            dino_round()
        elif num_items(Items.Pumpkin) >= CACT_AT:
            cact_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
                  break
              steps += 1
    -     change_hat(Hats.Gray_Hat)
    +     change_hat(Hats.Straw_Hat)
      
      def solve_maze():
    
    Write result the agent saw
    Saved farm (300 lines).
    Game time: 2h 4m 48s elapsed, 3h 55m 12s of budget remaining.
    run_program at 2h 04m for 300s (agent saw)
    Ran farm for 5m of game time; it is still running.
    Inventory change: cactus +16056, fertilizer -5, gold +15264, power -414.63, pumpkin -288, water +96, weird_substance +3384.
    Game time: 2h 10m 8s elapsed, 3h 49m 52s of budget remaining.
    Output:
    (none)
  16. r152h 20mRan301 lines · +4 −3 · ran 10m 10s
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 300
    CACT_AT = 2000
    WEIRD_HI = 300
    MAZE_BATCH = 4
    DINO_CACT = 4000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        elif num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
            dino_round()
        elif num_items(Items.Pumpkin) >= CACT_AT:
            cact_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      CACT_AT = 2000
      WEIRD_HI = 300
    - WEIRD_LO = 100
    + MAZE_BATCH = 4
      DINO_CACT = 4000
      
              harvest()
          plant(want)
    -     fert()
    +     if want != Entities.Cactus:
    +         fert()
      
      def goto(x, y):
              solve_maze()
          elif num_items(Items.Weird_Substance) >= WEIRD_HI:
    -         while num_items(Items.Weird_Substance) >= WEIRD_LO:
    +         for i in range(MAZE_BATCH):
                  if not maze_round():
                      break
    
    Write result the agent saw
    Saved farm (301 lines).
    Game time: 2h 20m 58s elapsed, 3h 39m 2s of budget remaining.
    run_program at 2h 21m for 600s (agent saw)
    Ran farm for 10m of game time; it is still running.
    Inventory change: carrot -288, fertilizer -168, gold +19872, power +693.92, water -241, weird_substance -576.
    Game time: 2h 31m 18s elapsed, 3h 28m 42s of budget remaining.
    Output:
    (none)
  17. r162h 31mRan301 lines · +3 −3 · ran 10m 20s
    PUMP_AT = 600
    HAY_AT = 400
    SUN_AT = 300
    CACT_AT = 2000
    WEIRD_HI = 300
    MAZE_BATCH = 3
    DINO_CACT = 4000
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        if num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
            dino_round()
        elif num_items(Items.Pumpkin) >= CACT_AT:
            cact_round()
        elif num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      CACT_AT = 2000
      WEIRD_HI = 300
    - MAZE_BATCH = 4
    + MAZE_BATCH = 3
      DINO_CACT = 4000
      
          if e == Entities.Hedge or e == Entities.Treasure:
              solve_maze()
    -     elif num_items(Items.Weird_Substance) >= WEIRD_HI:
    +     if num_items(Items.Weird_Substance) >= WEIRD_HI:
              for i in range(MAZE_BATCH):
                  if not maze_round():
                      break
    -     elif num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
    +     if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
              sun_round()
          elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
    
    Write result the agent saw
    Saved farm (301 lines).
    Game time: 2h 31m 38s elapsed, 3h 28m 22s of budget remaining.
    run_program at 2h 31m for 600s (agent saw)
    Ran farm for 10m of game time; it is still running.
    Inventory change: bone +40898, cactus +186052, carrot -288, fertilizer -1, gold +10656, hay +2304, power -272.28, pumpkin -2880, water -648, weird_substance -392.
    Game time: 2h 41m 58s elapsed, 3h 18m 2s of budget remaining.
    Output:
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: sun_round <- run_all <- worker <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- cact_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- cact_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
  18. r172h 42mRan311 lines · +19 −9 · ran 10m 20s
    PUMP_AT = 400
    HAY_AT = 400
    SUN_AT = 300
    WEIRD_HI = 300
    MAZE_BATCH = 3
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        while get_pos_x() != x:
            if not move(East):
                harvest()
        while get_pos_y() != y:
            if not move(North):
                harvest()
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    cycle = 0
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        if num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        step = cycle % 6
        cycle += 1
        if step == 0 or step == 3:
            if num_items(Items.Pumpkin) >= 300:
                cact_round()
            else:
                run_all(0, 0, 0)
        elif step == 1:
            if num_items(Items.Carrot) >= PUMP_AT:
                pump_round()
            else:
                run_all(0, 0, 0)
        elif step == 4:
            if num_items(Items.Cactus) >= 400:
                dino_round()
            else:
                run_all(0, 0, 0)
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
    - PUMP_AT = 600
    + PUMP_AT = 400
      HAY_AT = 400
      SUN_AT = 300
    - CACT_AT = 2000
      WEIRD_HI = 300
      MAZE_BATCH = 3
    - DINO_CACT = 4000
      
      def water():
          return solve_maze()
      
    + cycle = 0
      while True:
          e = get_entity_type()
          if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
              sun_round()
    -     elif num_items(Items.Cactus) >= DINO_CACT and num_items(Items.Bone) < num_items(Items.Cactus) / 4:
    -         dino_round()
    -     elif num_items(Items.Pumpkin) >= CACT_AT:
    -         cact_round()
    -     elif num_items(Items.Carrot) >= PUMP_AT:
    -         pump_round()
    +     step = cycle % 6
    +     cycle += 1
    +     if step == 0 or step == 3:
    +         if num_items(Items.Pumpkin) >= 300:
    +             cact_round()
    +         else:
    +             run_all(0, 0, 0)
    +     elif step == 1:
    +         if num_items(Items.Carrot) >= PUMP_AT:
    +             pump_round()
    +         else:
    +             run_all(0, 0, 0)
    +     elif step == 4:
    +         if num_items(Items.Cactus) >= 400:
    +             dino_round()
    +         else:
    +             run_all(0, 0, 0)
          else:
              run_all(0, 0, 0)
    
    Write result the agent saw
    Saved farm (311 lines).
    Game time: 2h 42m 28s elapsed, 3h 17m 32s of budget remaining.
    run_program at 2h 42m for 600s (agent saw)
    Ran farm for 10m of game time; it is still running.
    Inventory change: fertilizer +120, power -377.52, pumpkin -168, water +432.
    Game time: 2h 52m 38s elapsed, 3h 7m 22s of budget remaining.
    Output:
    (none)
  19. r182h 52mRan319 lines · +8 −0 · ran 5m 10s
    PUMP_AT = 400
    HAY_AT = 400
    SUN_AT = 300
    WEIRD_HI = 300
    MAZE_BATCH = 3
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        fails = 0
        while get_pos_x() != x:
            if not move(East):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
        while get_pos_y() != y:
            if not move(North):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    change_hat(Hats.Straw_Hat)
    cycle = 0
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        if num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        step = cycle % 6
        cycle += 1
        if step == 0 or step == 3:
            if num_items(Items.Pumpkin) >= 300:
                cact_round()
            else:
                run_all(0, 0, 0)
        elif step == 1:
            if num_items(Items.Carrot) >= PUMP_AT:
                pump_round()
            else:
                run_all(0, 0, 0)
        elif step == 4:
            if num_items(Items.Cactus) >= 400:
                dino_round()
            else:
                run_all(0, 0, 0)
        else:
            run_all(0, 0, 0)
    Changes from the previous revision
      
      def goto(x, y):
    +     fails = 0
          while get_pos_x() != x:
              if not move(East):
    +             fails += 1
                  harvest()
    +             if fails > 3:
    +                 change_hat(Hats.Straw_Hat)
          while get_pos_y() != y:
              if not move(North):
    +             fails += 1
                  harvest()
    +             if fails > 3:
    +                 change_hat(Hats.Straw_Hat)
      
      def mixed_tile():
          return solve_maze()
      
    + change_hat(Hats.Straw_Hat)
      cycle = 0
      while True:
    
    Write result the agent saw
    Saved farm (319 lines).
    Game time: 2h 53m 8s elapsed, 3h 6m 52s of budget remaining.
    run_program at 2h 53m for 300s (agent saw)
    Ran farm for 5m of game time; it is still running.
    Inventory change: bone +81992, cactus +61163, carrot -288, fertilizer -168, gold +6912, hay +10608, power +744.03, pumpkin -864, water -511, weird_substance -16, wood -960.
    Game time: 2h 58m 18s elapsed, 3h 1m 42s of budget remaining.
    Output:
    …------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
    Warning: Didn't have the required items to plant Entities.Carrot.
    In: worker <- mixed_tile <- ensure
    plant(want)
         ^^    
    --------------------------------------------------------------------
  20. r192h 58mRan316 lines · +14 −17 · ran 43m 57s
    PUMP_AT = 400
    HAY_AT = 400
    WOOD_AT = 300
    SUN_AT = 300
    WEIRD_HI = 300
    MAZE_BATCH = 3
    MIXED_BLOCK = 4
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        fails = 0
        while get_pos_x() != x:
            if not move(East):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
        while get_pos_y() != y:
            if not move(North):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT or num_items(Items.Wood) < WOOD_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def mixed_block():
        for i in range(MIXED_BLOCK):
            run_all(0, 0, 0)
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 3000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    change_hat(Hats.Straw_Hat)
    cycle = 0
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        if num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        step = cycle % 6
        cycle += 1
        if step == 0 and num_items(Items.Pumpkin) >= 300:
            cact_round()
        elif step == 2 and num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        elif step == 4 and num_items(Items.Cactus) >= 400:
            dino_round()
        else:
            mixed_block()
    Changes from the previous revision
      PUMP_AT = 400
      HAY_AT = 400
    + WOOD_AT = 300
      SUN_AT = 300
      WEIRD_HI = 300
      MAZE_BATCH = 3
    + MIXED_BLOCK = 4
      
      def water():
                  return
              want = Entities.Carrot
    -         if num_items(Items.Hay) < HAY_AT:
    +         if num_items(Items.Hay) < HAY_AT or num_items(Items.Wood) < WOOD_AT:
                  want = Entities.Grass
          if want == Entities.Carrot:
          return results
      
    + def mixed_block():
    +     for i in range(MIXED_BLOCK):
    +         run_all(0, 0, 0)
    + 
      def pump_round():
          run_all(1, 0, 0)
          step = cycle % 6
          cycle += 1
    -     if step == 0 or step == 3:
    -         if num_items(Items.Pumpkin) >= 300:
    -             cact_round()
    -         else:
    -             run_all(0, 0, 0)
    -     elif step == 1:
    -         if num_items(Items.Carrot) >= PUMP_AT:
    -             pump_round()
    -         else:
    -             run_all(0, 0, 0)
    -     elif step == 4:
    -         if num_items(Items.Cactus) >= 400:
    -             dino_round()
    -         else:
    -             run_all(0, 0, 0)
    +     if step == 0 and num_items(Items.Pumpkin) >= 300:
    +         cact_round()
    +     elif step == 2 and num_items(Items.Carrot) >= PUMP_AT:
    +         pump_round()
    +     elif step == 4 and num_items(Items.Cactus) >= 400:
    +         dino_round()
          else:
    -         run_all(0, 0, 0)
    +         mixed_block()
    
    Write result the agent saw
    Saved farm (316 lines).
    Game time: 2h 58m 38s elapsed, 3h 1m 22s of budget remaining.
    run_program at 2h 58m for 600s (agent saw)
    Ran farm for 10m of game time; it is still running.
    Inventory change: bone +163592, cactus +59920, carrot +53708, fertilizer -4, gold +21312, hay +29288, power +405.31, pumpkin +2550, water -19, weird_substance +8690, wood +177108.
    Game time: 3h 8m 48s elapsed, 2h 51m 12s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: mixed_block <- run_all <- worker <- mixed_tile <- ensure <- ...
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: pump_round <- run_all <- worker <- pump_tile <- water <- ...
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- pump_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- pump_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- mixed_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- cact_tile <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    use_item(Items.Water)
            ^^           
    --------------------------------------------------------------------
  21. r203h 42mRan316 lines · +4 −4 · ran 1h 29m
    PUMP_AT = 400
    HAY_AT = 400
    WOOD_AT = 300
    SUN_AT = 300
    WEIRD_HI = 300
    MAZE_BATCH = 8
    MIXED_BLOCK = 4
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        fails = 0
        while get_pos_x() != x:
            if not move(East):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
        while get_pos_y() != y:
            if not move(North):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT or num_items(Items.Wood) < WOOD_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def clear_tile():
        if get_entity_type() != None:
            harvest()
        if get_ground_type() == Grounds.Soil:
            till()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                elif mode == 7:
                    clear_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def mixed_block():
        for i in range(MIXED_BLOCK):
            run_all(0, 0, 0)
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def dino_dir():
        x = get_pos_x()
        y = get_pos_y()
        n = get_world_size()
        if x == 0:
            if y == 0:
                return East
            return South
        if y % 2 == 0:
            if x < n - 1:
                return East
            return North
        if x > 1:
            return West
        if y == n - 1:
            return West
        return North
    
    def dino_round():
        run_all(7, 0, 0)
        goto(0, 0)
        change_hat(Hats.Dinosaur_Hat)
        steps = 0
        limit = get_world_size() * get_world_size() * 90
        while steps < limit:
            if not move(dino_dir()):
                break
            steps += 1
        change_hat(Hats.Straw_Hat)
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 4000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    change_hat(Hats.Straw_Hat)
    cycle = 0
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        if num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        step = cycle % 6
        cycle += 1
        if step == 0 and num_items(Items.Pumpkin) >= 600:
            cact_round()
        elif step == 2 and num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        elif step == 4 and num_items(Items.Cactus) >= 600:
            dino_round()
        else:
            mixed_block()
    Changes from the previous revision
      SUN_AT = 300
      WEIRD_HI = 300
    - MAZE_BATCH = 3
    + MAZE_BATCH = 8
      MIXED_BLOCK = 4
      
          d = 0
          steps = 0
    -     while get_entity_type() != Entities.Treasure and steps < 3000:
    +     while get_entity_type() != Entities.Treasure and steps < 4000:
              steps += 1
              r = (d + 1) % 4
          step = cycle % 6
          cycle += 1
    -     if step == 0 and num_items(Items.Pumpkin) >= 300:
    +     if step == 0 and num_items(Items.Pumpkin) >= 600:
              cact_round()
          elif step == 2 and num_items(Items.Carrot) >= PUMP_AT:
              pump_round()
    -     elif step == 4 and num_items(Items.Cactus) >= 400:
    +     elif step == 4 and num_items(Items.Cactus) >= 600:
              dino_round()
          else:
    
    Write result the agent saw
    Saved farm (316 lines).
    Game time: 3h 42m 55s elapsed, 2h 17m 5s of budget remaining.
    run_program at 3h 42m for 600s (agent saw)
    Ran farm for 10m of game time; it is still running.
    Inventory change: cactus +130616, carrot +785536, fertilizer +189, gold +40960, hay +475200, power +363.58, pumpkin +94208, water +6079, weird_substance +364116, wood +4017920.
    Game time: 3h 53m 5s elapsed, 2h 6m 55s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- sun_plant_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- mixed_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- mixed_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- mixed_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
  22. r215h 13mRan276 lines · +3 −43 · ran 46m 38s
    PUMP_AT = 400
    HAY_AT = 400
    WOOD_AT = 300
    SUN_AT = 300
    WEIRD_HI = 300
    MAZE_BATCH = 8
    MIXED_BLOCK = 4
    
    def water():
        if get_water() < 0.5 and num_items(Items.Water) > 0:
            use_item(Items.Water)
    
    def fert():
        if num_items(Items.Fertilizer) > 0:
            use_item(Items.Fertilizer)
    
    def ensure(want):
        e = get_entity_type()
        if e == want:
            return
        if e != None and e != Entities.Grass and e != Entities.Dead_Pumpkin:
            harvest()
        plant(want)
        if want != Entities.Cactus:
            fert()
    
    def goto(x, y):
        fails = 0
        while get_pos_x() != x:
            if not move(East):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
        while get_pos_y() != y:
            if not move(North):
                fails += 1
                harvest()
                if fails > 3:
                    change_hat(Hats.Straw_Hat)
    
    def mixed_tile():
        x = get_pos_x()
        y = get_pos_y()
        e = get_entity_type()
        want = Entities.Tree
        if (x + y) % 2 == 1:
            if e == Entities.Carrot and not can_harvest():
                water()
                return
            want = Entities.Carrot
            if num_items(Items.Hay) < HAY_AT or num_items(Items.Wood) < WOOD_AT:
                want = Entities.Grass
        if want == Entities.Carrot:
            if get_ground_type() != Grounds.Soil:
                till()
        if want != Entities.Carrot:
            if get_ground_type() == Grounds.Soil:
                till()
        if can_harvest():
            harvest()
        if want != Entities.Grass:
            ensure(want)
        water()
    
    def pump_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        e = get_entity_type()
        if e != Entities.Pumpkin:
            ensure(Entities.Pumpkin)
            water()
            return False
        water()
        return can_harvest()
    
    def sun_plant_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Sunflower)
        water()
        if get_entity_type() == Entities.Sunflower:
            return measure()
        return 0
    
    def cact_tile():
        if get_ground_type() != Grounds.Soil:
            till()
        ensure(Entities.Cactus)
        water()
    
    def sort_line(dirn, n):
        for p in range(n - 1):
            swapped = False
            for q in range(n - 1):
                a = measure()
                b = measure(dirn)
                if a != None and b != None and a > b:
                    swap(dirn)
                    swapped = True
                move(dirn)
            move(dirn)
            if not swapped:
                return
    
    def worker(mode, k, D, best, cap):
        n = get_world_size()
        if mode == 1:
            done = False
            while not done:
                done = True
                x = k
                while x < n:
                    goto(x, 0)
                    for j in range(n):
                        if not pump_tile():
                            done = False
                        move(North)
                    x += D
                if num_items(Items.Carrot) < 2:
                    return 0
            return 0
        if mode == 5:
            y = k
            while y < n:
                goto(0, y)
                sort_line(East, n)
                y += D
            return 0
        if mode == 6:
            x = k
            while x < n:
                goto(x, 0)
                sort_line(North, n)
                x += D
            return 0
        res = 0
        newbest = 0
        x = k
        while x < n:
            goto(x, 0)
            for j in range(n):
                if mode == 0:
                    mixed_tile()
                elif mode == 2:
                    m = sun_plant_tile()
                    if m != None and m > res:
                        res = m
                elif mode == 3:
                    if get_entity_type() == Entities.Sunflower:
                        m = measure()
                        if m == best and res < cap and can_harvest():
                            harvest()
                            res += 1
                        else:
                            if m > newbest:
                                newbest = m
                    water()
                elif mode == 4:
                    cact_tile()
                move(North)
            x += D
        if mode == 3:
            return [res, newbest]
        return res
    
    def run_all(mode, best, cap):
        D = max_drones()
        handles = []
        failed = []
        for k in range(1, D):
            h = spawn_drone(worker, mode, k, D, best, cap)
            if h == None:
                failed.append(k)
            else:
                handles.append(h)
        results = [worker(mode, 0, D, best, cap)]
        for k in failed:
            results.append(worker(mode, k, D, best, cap))
        for h in handles:
            results.append(wait_for(h))
        return results
    
    def mixed_block():
        for i in range(MIXED_BLOCK):
            run_all(0, 0, 0)
    
    def pump_round():
        run_all(1, 0, 0)
        if get_entity_type() == Entities.Pumpkin and can_harvest():
            harvest()
    
    def cact_round():
        run_all(4, 0, 0)
        run_all(5, 0, 0)
        run_all(6, 0, 0)
        if get_entity_type() == Entities.Cactus and can_harvest():
            harvest()
    
    def sun_round():
        n = get_world_size()
        rs = run_all(2, 0, 0)
        best = 0
        for r in rs:
            best = max(best, r)
        remaining = n * n
        while remaining > 10 and best > 0:
            cap = (remaining - 10) // max_drones() + 1
            rs = run_all(3, best, cap)
            h = 0
            nb = 0
            for r in rs:
                h += r[0]
                nb = max(nb, r[1])
            remaining -= h
            if h == 0 and nb == 0:
                break
            best = nb
    
    def solve_maze():
        dirs = [North, East, South, West]
        d = 0
        steps = 0
        while get_entity_type() != Entities.Treasure and steps < 6000:
            steps += 1
            r = (d + 1) % 4
            l = (d + 3) % 4
            if can_move(dirs[r]):
                d = r
                move(dirs[d])
            elif can_move(dirs[d]):
                move(dirs[d])
            elif can_move(dirs[l]):
                d = l
                move(dirs[d])
            else:
                d = (d + 2) % 4
                move(dirs[d])
        if get_entity_type() == Entities.Treasure:
            harvest()
            return True
        harvest()
        return False
    
    def maze_round():
        n = get_world_size()
        amount = n * 2 ** (num_unlocked(Unlocks.Mazes) - 1)
        if num_items(Items.Weird_Substance) < amount:
            return False
        if get_entity_type() != Entities.Bush:
            if get_entity_type() != None:
                harvest()
            plant(Entities.Bush)
        use_item(Items.Weird_Substance, amount)
        return solve_maze()
    
    change_hat(Hats.Straw_Hat)
    cycle = 0
    while True:
        e = get_entity_type()
        if e == Entities.Hedge or e == Entities.Treasure:
            solve_maze()
        if num_items(Items.Weird_Substance) >= WEIRD_HI:
            for i in range(MAZE_BATCH):
                if not maze_round():
                    break
        if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
            sun_round()
        step = cycle % 4
        cycle += 1
        if step == 0 and num_items(Items.Pumpkin) >= 2000:
            cact_round()
        elif step == 2 and num_items(Items.Carrot) >= PUMP_AT:
            pump_round()
        else:
            mixed_block()
    Changes from the previous revision
          water()
      
    - def clear_tile():
    -     if get_entity_type() != None:
    -         harvest()
    -     if get_ground_type() == Grounds.Soil:
    -         till()
    - 
      def sort_line(dirn, n):
          for p in range(n - 1):
                  elif mode == 4:
                      cact_tile()
    -             elif mode == 7:
    -                 clear_tile()
                  move(North)
              x += D
              best = nb
      
    - def dino_dir():
    -     x = get_pos_x()
    -     y = get_pos_y()
    -     n = get_world_size()
    -     if x == 0:
    -         if y == 0:
    -             return East
    -         return South
    -     if y % 2 == 0:
    -         if x < n - 1:
    -             return East
    -         return North
    -     if x > 1:
    -         return West
    -     if y == n - 1:
    -         return West
    -     return North
    - 
    - def dino_round():
    -     run_all(7, 0, 0)
    -     goto(0, 0)
    -     change_hat(Hats.Dinosaur_Hat)
    -     steps = 0
    -     limit = get_world_size() * get_world_size() * 90
    -     while steps < limit:
    -         if not move(dino_dir()):
    -             break
    -         steps += 1
    -     change_hat(Hats.Straw_Hat)
    - 
      def solve_maze():
          dirs = [North, East, South, West]
          d = 0
          steps = 0
    -     while get_entity_type() != Entities.Treasure and steps < 4000:
    +     while get_entity_type() != Entities.Treasure and steps < 6000:
              steps += 1
              r = (d + 1) % 4
          if num_items(Items.Power) < SUN_AT and num_items(Items.Carrot) >= 100:
              sun_round()
    -     step = cycle % 6
    +     step = cycle % 4
          cycle += 1
    -     if step == 0 and num_items(Items.Pumpkin) >= 600:
    +     if step == 0 and num_items(Items.Pumpkin) >= 2000:
              cact_round()
          elif step == 2 and num_items(Items.Carrot) >= PUMP_AT:
              pump_round()
    -     elif step == 4 and num_items(Items.Cactus) >= 600:
    -         dino_round()
          else:
              mixed_block()
    
    Write result the agent saw
    Saved farm (276 lines).
    Game time: 5h 13m 12s elapsed, 46m 48s of budget remaining.
    run_program at 5h 13m for 900s (agent saw)
    Ran farm for 15m of game time; it is still running.
    Inventory change: cactus +937024, carrot +7543224, fertilizer -224, gold +127776, hay +2785024, power +2581.01, pumpkin +677344, water +17690, weird_substance +3566032, wood +34993664.
    Game time: 5h 28m 22s elapsed, 31m 38s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- pump_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- sun_plant_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^                
    --------------------------------------------------------------------
hat.py1 write · 1 ran · first at 2h 04m
  1. r12h 04mRanFinal2 lines · ran 1s
    change_hat(Hats.Straw_Hat)
    print(num_items(Items.Bone))
    Write result the agent saw
    Saved hat (2 lines).
    Game time: 2h 4m 17s elapsed, 3h 55m 43s of budget remaining.
    run_program at 2h 04m for 10s (agent saw)
    Ran hat for 1s of game time; it finished.
    Inventory change: bone +20449, power -0.03, water +1.
    Game time: 2h 4m 38s elapsed, 3h 55m 22s of budget remaining.
    Output:
    20449
log31 said · 51 thought · 261 tool calls

Step by step

  1. 0ssaidI'll start by observing the farm and checking the docs and research menu.
  2. 0sobserve
    result
    Game time: 10s elapsed, 5h 59m 50s of budget remaining.
    Program: none running.
    Inventory: empty.
    Farm 1x1. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass.
    y= 0  _Gr3*
    Recent output:
    (none)
  3. 10sdocs_list
    result
    docs/home.md  General Info
    unlocks/auto_unlock  Auto Unlock
    unlocks/cactus  Cactus
    unlocks/carrots  Carrots
    unlocks/costs  Costs
    unlocks/debug  Debug
    unlocks/debug_2  Debug_2
    unlocks/dictionaries  Dictionaries
    unlocks/dinosaurs  Dinosaurs
    unlocks/expand  Expand
    unlocks/fertilizer  Fertilizer
    unlocks/functions  Functions
    unlocks/grass  Grass
    unlocks/hats  Hats
    unlocks/import  Import
    unlocks/leaderb…
  4. 20sresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; requires pumpkins
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 0/10; cost wood 50; requires plant
      ## Carrots Till the soil and plant carrots. till() plant(Entities.Carrot)
    costs (Costs) le…
  5. 30sdocs_read path="docs/home.md"
    result
    ## General Info
    [External Editor](docs/external_editor.md)      [First Program](docs/first_program.md)      [Getting Started](docs/getting_started.md)      [Loading Backups](docs/backup.md)            [Credits](docs/credits.md)
    
    ## Programming
    [Comments](docs/scripting/comments.md)      
    
    ## Unlocks
    [Grass](unlocks/grass)      
    
    ## Built-in Functions
    [do_a_flip](functions/do_a_flip)      [harvest]…
  6. 40sdocs_read path="docs/first_program.md"
    result
    # First Program
    ## Text editor
    All programming is done in code windows. Each code window corresponds to a text file containing code. 
    You can rename the file by clicking on its name at the top of the window.
    
    The code can be edited like in any text editor as long as it's not running.
    You can execute the program directly by pressing the green play button in the code window.
    ![](PlayButton50)
    
    You c…
  7. 50sdocs_read path="unlocks/grass"
    result
    ## Grass
    Increases the yield of grass.
    100% => 200%
    
    ### Unlock Cost [Current cost: hay=300]
    Game time: 1m elapsed, 5h 59m of budget remaining.
  8. 1m 00sdocs_read path="functions/harvest"
    result
    harvest()
    Harvests the entity under the drone. 
    If you harvest an entity that can't be harvested, it will be destroyed.
    
    returns True if an entity was removed, False otherwise.
    
    takes 200 ticks to execute if an entity was removed, 1 tick otherwise.
    
    example:
    harvest()
    Game time: 1m 10s elapsed, 5h 58m 50s of budget remaining.
  9. 1m 10swrite_program name="h0" · evidence
    result
    Saved h0 (40 lines).
    Game time: 1m 20s elapsed, 5h 58m 40s of budget remaining.
  10. 1m 20srun_program name="h0" seconds=60
    result
    Ran h0 for 20s of game time; it finished.
    Inventory change: hay +40.
    Game time: 1m 50s elapsed, 5h 58m 10s of budget remaining.
    Output:
    (none)
  11. 1m 50sbuy_upgrade upgrades=["loops","speed"] · evidence
    result
    Bought loops, now level 1. Paid hay 5. Its tutorial is docs page docs/scripting/while.md.
    Bought speed, now level 1. Paid hay 20. Its tutorial is docs page docs/unlocks/speed.md.
    Game time: 2m elapsed, 5h 58m of budget remaining.
  12. 2m 00swrite_program name="loop" · evidence
    result
    Saved loop (2 lines).
    Game time: 2m 10s elapsed, 5h 57m 50s of budget remaining.
  13. 2m 10srun_program name="loop" seconds=40
    result
    Ran loop for 40s of game time; it is still running.
    Inventory change: hay +1.
    Game time: 3m elapsed, 5h 57m of budget remaining.
    Output:
    (none)
  14. 3m 00ssaidHarvest loop is running but barely producing hay — checking the farm state to see why.
  15. 3m 00sobserve
    result
    Game time: 3m 10s elapsed, 5h 56m 50s of budget remaining.
    Program: loop (running).
    Inventory: hay 16.
    Farm 1x1. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass.
    y= 0  _Gr2*
    Recent output:
    (none)
  16. 3m 10swait seconds=300 until_resources={"hay":30}
    result
    Waited 5m (time up). Program: loop running.
    Inventory change: no change.
    Game time: 8m 20s elapsed, 5h 51m 40s of budget remaining.
  17. 8m 20sstop_program
    result
    Program stopped.
    Game time: 8m 30s elapsed, 5h 51m 30s of budget remaining.
  18. 8m 30sinspect_tile x=0 y=0
    result
    (0,0) `x = 0, y = 0`
    
    ### `Entities.Grass`
    Total grow time: 0.5 seconds
    Grown 100%
    When harvested, gives:
    
    ### `Grounds.Grassland`
    Water level: 0
    Yield: hay 1
    Game time: 8m 40s elapsed, 5h 51m 20s of budget remaining.
  19. 8m 40sdocs_read path="docs/scripting/while.md"
    result
    # While Loop
    You have unlocked the `while` loop and the values `True` and `False`. The `while` loop keeps executing the loop body as long as the condition is `True`.
    
    `while condition:
    	#loop body`
    
    Don't worry about creating infinite loops. The delays in the execution will prevent the program from freezing.
    
    ## For Beginners
    Perhaps you have already tried to put several `harvest()` calls in a row…
  20. 8m 50sdocs_read path="objects/grass"
    result
    ## Grass
    Grows automatically on grassland. Harvest it to obtain Items.Hay.
    
    Base growth time between 0.5 and 0.5 seconds.
    Can grow on soil or grassland.
    Game time: 9m elapsed, 5h 51m of budget remaining.
  21. 9m 00srun_program name="loop" seconds=30
    result
    Ran loop for 30s of game time; it is still running.
    Inventory change: hay +1.
    Game time: 9m 40s elapsed, 5h 50m 20s of budget remaining.
    Output:
    (none)
  22. 9m 40sobserve
    result
    Game time: 9m 50s elapsed, 5h 50m 10s of budget remaining.
    Program: loop (running).
    Inventory: hay 17.
    Farm 1x1. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass.
    y= 0  _Gr2*
    Recent output:
    (none)
  23. 9m 50ssaidThe while loop appears to harvest grass before it regrows (destroying it), while the straight-line program worked. I'll use a long straight-line harvester to earn enough hay for expand/plant/senses.
  24. 9m 50swrite_program name="h1" · evidence
    result
    Saved h1 (313 lines).
    Game time: 10m elapsed, 5h 50m of budget remaining.
  25. 10m 00srun_program name="h1" seconds=200
    result
    Ran h1 for 1m 44s of game time; it finished.
    Inventory change: no change.
    Game time: 11m 54s elapsed, 5h 48m 6s of budget remaining.
    Output:
    (none)
  26. 11m 54sdocs_read path="functions/do_a_flip"
    result
    do_a_flip() 
    Makes the drone do a flip! This action is not affected by speed upgrades.
    
    returns None
    
    takes 1s to execute.
    
    example:
    while True:
        do_a_flip()
    Game time: 12m 4s elapsed, 5h 47m 56s of budget remaining.
  27. 12m 04sdocs_read path="docs/unlocks/speed.md"
    result
    # Speed Upgrade
    The execution speed has been doubled. The problem is that the drone now harvests faster than the grass can grow resulting in no harvest at all. To deal with this [if](docs/scripting/if.md) branches and the [can_harvest](functions/can_harvest) function are now unlocked.
    
    ## Checking Before Harvesting
    So far we only had `True` and `False` as conditions, which is of course not very us…
  28. 12m 14ssaidGot it — `can_harvest()` and `if` are unlocked. Fixing the loop now.
  29. 12m 14swrite_program name="loop" · evidence
    result
    Saved loop (3 lines).
    Game time: 12m 24s elapsed, 5h 47m 36s of budget remaining.
  30. 12m 24srun_program name="loop" seconds=60
    result
    Ran loop for 1m of game time; it is still running.
    Inventory change: hay +120.
    Game time: 13m 34s elapsed, 5h 46m 26s of budget remaining.
    Output:
    (none)
  31. 13m 34ssaidNow at ~137 hay. Buying expand + plant and reading their docs in parallel.
  32. 13m 34sbuy_upgrade upgrades=["expand","plant"] · evidence
    result
    Bought expand, now level 1. Paid hay 30. Its tutorial is docs page docs/unlocks/expand_1.md.
    Bought plant, now level 1. Paid hay 50. Its tutorial is docs page docs/unlocks/plant.md.
    Game time: 13m 44s elapsed, 5h 46m 16s of budget remaining.
  33. 13m 44sdocs_read path="unlocks/expand"
    result
    ## Expand
    Expands the farm. This also clears the farm.
    1x3 => 3x3
    
    ### Unlock Cost [Current cost: wood=20]
    
    [Tutorial](docs/unlocks/expand_1.md)
    Game time: 13m 54s elapsed, 5h 46m 6s of budget remaining.
  34. 13m 54sdocs_read path="unlocks/plant"
    result
    ## Plant
    Unlocks planting.
    
    plant(Entities.Bush)
    
    [Tutorial](docs/unlocks/plant.md)
    Game time: 14m 4s elapsed, 5h 45m 56s of budget remaining.
  35. 14m 04sdocs_read path="docs/unlocks/expand_1.md"
    result
    # Expand 1
    Your farm has grown! This space is not much use if you can't move the drone, so there is a new function `move()` that moves the drone. `move()` requires that you specify the direction in which you want the drone to move. There are four new constants for this: `North, East, South, West`
    
    For example, `move(North)` will move the drone one square to the north.
    
    If you move over the edge of…
  36. 14m 14sdocs_read path="docs/unlocks/plant.md"
    result
    # Plant
    Grass is nice because it grows automatically. All other plants have to be planted with the `plant()` function. The only plant you can plant right now is a bush.
    You can pass the type of plant you want to plant to the function like this:
    
    `plant(Entities.Bush)`
    
    This will plant a bush under the drone.
    
    Call `clear()` to reset the farm to all grass and reset the drone position.
    
    It seems tha…
  37. 14m 24sobserve
    result
    Game time: 14m 34s elapsed, 5h 45m 26s of budget remaining.
    Program: loop (running).
    Inventory: hay 176.
    Farm 1x3. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass.
    y= 2  _Gr3
    y= 1  _Gr3
    y= 0  _Gr1*
    Recent output:
    (none)
  38. 14m 34sdocs_search query="bush"
    result
    docs/home.md: …functions/plant) [tap](functions/tap) ## Items [Hay](items/hay) [Wood](items/wood) ## Entities [Bush](objects/bush) [Grass](objects/grass) ## Grounds [Grassland](objects/grassland) [Soil](objects/soil)…
    unlocks/lists: …## Lists Use lists to store lots of values. plants = [Entities.Grass, Entities.Bush, Entities.Tree] for p in plants: plant(p) move(North) ### Unlock Cost [Current cos…
  39. 14m 44swrite_program name="bush" · evidence
    result
    Saved bush (5 lines).
    Game time: 14m 54s elapsed, 5h 45m 6s of budget remaining.
  40. 14m 54srun_program name="bush" seconds=90
    result
    Ran bush for 1m 30s of game time; it is still running.
    Inventory change: hay +7, wood +53.
    Game time: 16m 34s elapsed, 5h 43m 26s of budget remaining.
    Output:
    (none)
  41. 16m 34sdocs_read path="objects/bush"
    result
    ## Bush
    A small bush that drops Items.Wood.
    
    Base growth time between 3.2 and 4.8 seconds.
    Can grow on grassland or soil.
    
    For more related information see: [Plant](docs/unlocks/plant.md)
    Game time: 16m 44s elapsed, 5h 43m 16s of budget remaining.
  42. 16m 44ssaidHave ~183 hay, 53 wood. Buying expand (3x3) + operators now; carrots once wood reaches 50 again.
  43. 16m 44sbuy_upgrade upgrades=["expand","operators"] · evidence
    result
    Bought expand, now level 2. Paid wood 20. Its tutorial is docs page docs/unlocks/expand_1.md.
    Bought operators, now level 1. Paid hay 150, wood 10. Its tutorial is docs page docs/scripting/operators.md.
    Game time: 16m 54s elapsed, 5h 43m 6s of budget remaining.
  44. 16m 54sdocs_read path="unlocks/senses"
    result
    ## Senses
    The drone can see what's under it and where it is.
    
    if get_pos_x() < 5 and num_items(Items.Wood) < 200:
        plant(Entities.Bush)
    
    ### Unlock Cost [Current cost: hay=100]
    Game time: 17m 4s elapsed, 5h 42m 56s of budget remaining.
  45. 17m 04swrite_program name="bush3" · evidence
    result
    Saved bush3 (39 lines).
    Game time: 17m 14s elapsed, 5h 42m 46s of budget remaining.
  46. 17m 14srun_program name="bush3" seconds=120
    result
    Ran bush3 for 2m of game time; it is still running.
    Inventory change: hay +37, wood +106.
    Game time: 19m 24s elapsed, 5h 40m 36s of budget remaining.
    Output:
    (none)
  47. 19m 24sbuy_upgrade upgrades=["carrots"] · evidence
    result
    Bought carrots, now level 1. Paid wood 50. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 19m 34s elapsed, 5h 40m 26s of budget remaining.
  48. 19m 34sdocs_read path="unlocks/carrots"
    result
    ## Carrots
    Increases the yield and cost of carrots.
    100% => 200%
    
    ### Unlock Cost [Current cost: wood=250]
    
    [Tutorial](docs/unlocks/carrots.md)
    Game time: 19m 44s elapsed, 5h 40m 16s of budget remaining.
  49. 19m 44sdocs_read path="docs/scripting/operators.md"
    result
    # Operators
    arithmetic operators: `+, -, *, /, //, %, **`
    comparison operators: `==, !=, <=, >=, <, >`
    boolean operators: `not, and, or`
    
    Note: All numbers in the game are floating point numbers. So all arithmetic operators are floating point operators.
    `//` is defined to just floor the number after the division.
    
    For assignment operators you need to unlock the "Variables" unlock.
    
    ## Introduction…
  50. 19m 54sdocs_read path="docs/unlocks/carrots.md"
    result
    # Carrots
    Before you can plant carrots with `plant(Entities.Carrot)`, you have to till the soil. This will change the ground to `Grounds.Soil`. To till the soil, simply call `till()`. Calling `till()` again will change it back to `Grounds.Grassland`.
    
    Planting carrots costs wood and hay. These items will be automatically removed when calling `plant(Entities.Carrot)`.
    
    You can see the cost of any p…
  51. 20m 04sdocs_search query="growth time"
    result
    objects/bush: …## Bush A small bush that drops Items.Wood. Base growth time between 3.2 and 4.8 seconds. Can grow on grassland or soil. For more related information see: [Plant](docs/unlocks/plant.md)…
    objects/carrot: …## Carrot Carrots! Base growth time between 4.8 and 7.2 seconds. Can grow on soil. ### Plant Cost [Current cost: hay=1, wood=1] For more related information see: [Carrots](docs/unlo…
  52. 20m 14swait seconds=120 until_resources={"hay":100}
    result
    Waited 0s (hay reached 146). Program: bush3 running.
    Inventory change: no change.
    Game time: 20m 24s elapsed, 5h 39m 36s of budget remaining.
  53. 20m 24ssaidBuying senses (hay 146 now) and reading its tutorial so I can write a position-aware 3x3 program with grass, bushes, and carrots.
  54. 20m 24sbuy_upgrade upgrades=["senses"] · evidence
    result
    Bought senses, now level 1. Paid hay 100. Its tutorial is docs page docs/unlocks/senses.md.
    Game time: 20m 34s elapsed, 5h 39m 26s of budget remaining.
  55. 20m 34sdocs_read path="docs/unlocks/senses.md"
    result
    # Senses
    The drone can see now! 
    
    The functions `get_pos_x()` and `get_pos_y()` return the current x and y position of the drone. At the start position they are both `0`. The x position increases by `1` every tile towards `East` and the y position increases by `1` every tile towards `North`.
    
    `num_items(item)` returns how many of an item you have.
    For example `num_items(Items.Hay)` returns how muc…
  56. 20m 44sobserve
    result
    Game time: 20m 54s elapsed, 5h 39m 6s of budget remaining.
    Program: bush3 (running).
    Inventory: hay 49, wood 213.
    Farm 3x3. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Bu=bush, Gr=grass.
    y= 2  _Bu3  _Bu2  _Bu1
    y= 1  _Gr3  _Bu3  _Bu1
    y= 0  _Bu3  _Bu2  _Bu3*
    Recent output:
    …
  57. 20m 54swrite_program name="farm3" · evidence
    result
    Saved farm3 (19 lines).
    Game time: 21m 4s elapsed, 5h 38m 56s of budget remaining.
  58. 21m 04srun_program name="farm3" seconds=90
    result
    Ran farm3 for 1m 30s of game time; it is still running.
    Inventory change: carrot +39, hay +46, wood +16.
    Game time: 22m 44s elapsed, 5h 37m 16s of budget remaining.
    Output:
    (none)
  59. 22m 44ssaidBuying variables and watering now; reading their tutorials in the same step.
  60. 22m 44sbuy_upgrade upgrades=["variables","watering"] · evidence
    result
    Bought variables, now level 1. Paid carrot 35. Its tutorial is docs page docs/scripting/variables.md.
    Bought watering, now level 1. Paid wood 50. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 22m 54s elapsed, 5h 37m 6s of budget remaining.
  61. 22m 54sdocs_read path="unlocks/watering"
    result
    ## Watering
    Receive more water.
    0.1/s => 0.2/s
    
    ### Unlock Cost [Current cost: wood=200]
    
    [Tutorial](docs/unlocks/watering.md)
    Game time: 23m 4s elapsed, 5h 36m 56s of budget remaining.
  62. 23m 04sdocs_read path="unlocks/trees"
    result
    ## Trees
    Unlocks trees.
    
    plant(Entities.Trees)
    
    ### Unlock Cost [Current cost: wood=50, carrot=70]
    Game time: 23m 14s elapsed, 5h 36m 46s of budget remaining.
  63. 23m 14sdocs_read path="docs/unlocks/watering.md"
    result
    # Watering
    Plants grow faster when they are watered. The ground has a water level ranging from `0` to `1`.
    The function `get_water()` returns the water level of the ground it is over.
    
    The growth speed of a plant scales linearly from 1x speed at water level 0 to 5x speed at water level 1.
    
    The ground dries up over time: On average, it loses 1% of its current water per second, but there is some ran…
  64. 23m 24sdocs_read path="docs/scripting/variables.md"
    result
    # Variables
    Variables can be thought of as named containers that can hold a value.
    The `=` operator is used to declare a variable and store a value in it.
    
    `variable_name = value`
    
    The left hand side of the operator is the variable name. You can give it any name you want.
    The right hand side is an expression whose resulting value will be stored in the variable.
    
    Declare a variable named `a` and st…
  65. 23m 34swait seconds=120 until_resources={"carrot":40}
    result
    Waited 0s (carrot reached 40). Program: farm3 running.
    Inventory change: no change.
    Game time: 23m 44s elapsed, 5h 36m 16s of budget remaining.
  66. 23m 44sbuy_upgrade upgrades=["functions"] · evidence
    result
    Bought functions, now level 1. Paid carrot 40. Its tutorial is docs page docs/scripting/functions.md.
    Game time: 23m 54s elapsed, 5h 36m 6s of budget remaining.
  67. 23m 54sdocs_read path="unlocks/pumpkins"
    result
    ## Pumpkins
    Pumpkins!
    
    plant(Entities.Pumpkin)
    
    ### Unlock Cost [Current cost: wood=500, carrot=200]
    Game time: 24m 4s elapsed, 5h 35m 56s of budget remaining.
  68. 24m 04sdocs_read path="unlocks/sunflowers"
    result
    ## Sunflowers
    Sunflowers and Power.
    
    plant(Entities.Sunflowers)
    
    ### Unlock Cost [Current cost: carrot=500]
    Game time: 24m 14s elapsed, 5h 35m 46s of budget remaining.
  69. 24m 14swait seconds=120 until_resources={"carrot":70}
    result
    Waited 52s (carrot reached 70). Program: farm3 running.
    Inventory change: carrot +49, hay +15, water +5, wood +18.
    Game time: 25m 16s elapsed, 5h 34m 44s of budget remaining.
  70. 25m 16sresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; requires pumpkins
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 1/10; cost wood 250; can buy now; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrots. 100% =…
  71. 25m 26ssaidBuying speed (cheap at 20 wood) and trees now; reading the trees and functions docs alongside.
  72. 25m 26sbuy_upgrade upgrades=["speed","trees"] · evidence
    result
    Bought speed, now level 2. Paid wood 20. Its tutorial is docs page docs/unlocks/speed.md.
    Bought trees, now level 1. Paid wood 50, carrot 70. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 25m 36s elapsed, 5h 34m 24s of budget remaining.
  73. 25m 36sdocs_read path="docs/scripting/functions.md"
    result
    # Functions
    Use the `def` keyword to define a new function:
    `def f(arg1, arg2 = False):
    	#function code`
    
    You can use the call operator `()` to call the function:
    `f(42)`
    
    Also see [Scopes](docs/scripting/scopes.md) to learn about local and global variables in functions.
    
    ## Introduction
    You've already seen built-in functions like `harvest()`.
    You can also define your own functions which allows st…
  74. 25m 46sdocs_search query="tree"
    result
    docs/home.md: …md) [Plant](docs/unlocks/plant.md) [Senses](docs/unlocks/senses.md) [Speed](docs/unlocks/speed.md) [Trees](docs/unlocks/trees.md) [Variables](docs/scripting/variables.md) [Watering](docs/unlocks/watering.md) ## Built-in Functions [can_harvest](functions/can_harvest) [clear](fun…
    unlocks/lists: …## Lists Use lists to store lots of values. plants = [Entities.Grass, Entities.Bush, Enti…
  75. 25m 56swait seconds=120 until_resources={"carrot":20}
    result
    Waited 0s (carrot reached 44). Program: farm3 running.
    Inventory change: no change.
    Game time: 26m 6s elapsed, 5h 33m 54s of budget remaining.
  76. 26m 06sdocs_search query="world_size"
    result
    docs/home.md: … [get_pos_x](functions/get_pos_x) [get_pos_y](functions/get_pos_y) [get_water](functions/get_water) [get_world_size](functions/get_world_size) [harvest](functions/harvest) [move](functions/move) [num_items](functions/num_items) [num_unlocked](functions/num_unlocked) [pet_the_pigg…
    unlocks/debug_2: …## Debug_2 Functions to temporarily slow down the execution and make the farm smaller…
  77. 26m 16sdocs_read path="docs/unlocks/trees.md"
    result
    # Trees
    [Trees](objects/tree) are a better way to get wood than bushes. They give 5 wood each. Like bushes, they can be planted on grass or soil.
    
    Trees like to have some space and planting them right next to each other will slow down their growth. The growing time is doubled for each tree that is on a tile directly to the north, east, west or south of it. So if you plant trees on every tile, they…
  78. 26m 26sbuy_upgrade upgrades=["expand"] · evidence
    result
    Bought expand, now level 3. Paid wood 30, carrot 20. Its tutorial is docs page docs/unlocks/expand_1.md.
    Game time: 26m 36s elapsed, 5h 33m 24s of budget remaining.
  79. 26m 36swrite_program name="farm" · evidence
    result
    Saved farm (26 lines).
    Game time: 26m 46s elapsed, 5h 33m 14s of budget remaining.
  80. 26m 46srun_program name="farm" seconds=120
    result
    Ran farm for 2m of game time; it is still running.
    Inventory change: carrot +129, hay -10, water -24, wood +529.
    Game time: 28m 56s elapsed, 5h 31m 4s of budget remaining.
    Output:
    (none)
  81. 28m 56sobserve
    result
    Game time: 29m 6s elapsed, 5h 30m 54s of budget remaining.
    Program: farm (running).
    Inventory: hay 187, wood 819, carrot 206.
    Farm 4x4. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass, Tr=tree, Ca=carrot.
    y= 3  _Gr3  _Tr3  #Ca3  _Tr1
    y= 2  _Tr3  #Ca3  _Tr3  #Ca1
    y= 1…
  82. 29m 06sbuy_upgrade upgrades=["import","carrots"] · evidence
    result
    Bought import, now level 1. Paid carrot 80. Its tutorial is docs page docs/scripting/import.md.
    Bought carrots, now level 2. Paid wood 250. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 29m 16s elapsed, 5h 30m 44s of budget remaining.
  83. 29m 16swait seconds=120 until_resources={"carrot":200}
    result
    Waited 24s (carrot reached 207). Program: farm running.
    Inventory change: carrot +50, hay -16, water +1, wood +136.
    Game time: 29m 50s elapsed, 5h 30m 10s of budget remaining.
  84. 29m 50sresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; requires pumpkins
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 2/10; cost wood 1250; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of …
  85. 30m 00ssaidBuying pumpkins now and reading its docs; expand to 6x6 and speed next once carrots recover.
  86. 30m 00sbuy_upgrade upgrades=["pumpkins"] · evidence
    result
    Bought pumpkins, now level 1. Paid wood 500, carrot 200. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Game time: 30m 10s elapsed, 5h 29m 50s of budget remaining.
  87. 30m 10sdocs_read path="docs/unlocks/pumpkins.md"
    result
    # Pumpkins
    [Pumpkins](objects/pumpkin) grow like carrots on tilled soil. Planting them costs carrots.
    
    When all the pumpkins in a square are fully grown, they will grow together to form a giant pumpkin. Unfortunately, pumpkins have a 20% chance of dying once they are fully grown, so you will need to replant the dead ones if you want them to merge. 
    
    When a pumpkin dies, it leaves behind a dead pum…
  88. 30m 20sdocs_read path="objects/pumpkin"
    result
    ## Pumpkin
    Pumpkins grow together when they are next to other fully grown pumpkins. About 1 in 5 pumpkins dies when it grows up.
    
    Base growth time between 0.2 and 3.8 seconds.
    Can grow on soil.
    
    ### Plant Cost [Current cost: carrot=1]
    
    For more related information see: [Pumpkins](docs/unlocks/pumpkins.md)
    Game time: 30m 30s elapsed, 5h 29m 30s of budget remaining.
  89. 30m 30sdocs_read path="docs/unlocks/expand_2.md"
    result
    # Expand 2
    Your farm has expanded again! Now the tiles are no longer in a nice row, so you need to find a way to traverse a square grid.
    
    With the `while` loop this is not possible until you unlock senses and operators.
    It is time to introduce the `for` loop.
    
    You can read all about the `for` loop on the [For Loop](docs/scripting/for.md) page, but for now you will only need it to repeat code a fix…
  90. 30m 40swait seconds=120 until_resources={"carrot":50}
    result
    Waited 0s (carrot reached 163). Program: farm running.
    Inventory change: no change.
    Game time: 30m 50s elapsed, 5h 29m 10s of budget remaining.
  91. 30m 50sbuy_upgrade upgrades=["expand","speed"] · evidence
    result
    Bought expand, now level 4. Paid wood 100, carrot 50. Its tutorial is docs page docs/unlocks/expand_1.md.
    Bought speed, now level 3. Paid wood 50, carrot 50. Its tutorial is docs page docs/unlocks/speed.md.
    Game time: 31m elapsed, 5h 29m of budget remaining.
  92. 31m 00sdocs_search query="dead"
    result
    docs/home.md: …n](items/pumpkin) [Water](items/water) ## Entities [Bush](objects/bush) [Carrot](objects/carrot) [Dead_Pumpkin](objects/dead_pumpkin) [Grass](objects/grass) [Pumpkin](objects/pumpkin) [Tree](objects/tree) ## Grounds [Grassland](objects/grassland) [Soil](objects/soil)…
    docs/unlocks/pumpkins.md: … pumpkin. Unfortunately, pumpkins have a 20% chance of dying once they are fully grown, s…
  93. 31m 10sdocs_read path="docs/scripting/for.md"
    result
    # For Loop
    The `for` loop works like in Python. (Called a foreach loop in some languages, not to be confused with the C-style for loop, which is a different thing).
    
    `for i in sequence:
    	#do something with i`
    
    Similar to the `while` loop, the `for` loop also repeatedly calls a block of code. Instead of looping based on a condition, it executes the loop body once for each element in a sequence.
    
    ##…
  94. 31m 20swrite_program name="farm" · evidence
    result
    Stop the program before editing it.
  95. 31m 30sstop_program
    result
    Program stopped.
    Game time: 31m 40s elapsed, 5h 28m 20s of budget remaining.
  96. 31m 40swrite_program name="farm" · evidence
    result
    Saved farm (68 lines).
    Game time: 31m 50s elapsed, 5h 28m 10s of budget remaining.
  97. 31m 50ssaidRunning the new 6x6 mode-switching program (trees/carrots/grass, with pumpkin rounds when carrots pile up).
  98. 31m 50srun_program name="farm" seconds=180
    result
    Ran farm for 3m of game time; it is still running.
    Inventory change: carrot -40, hay -55, pumpkin +864, water -2, wood +68.
    Game time: 35m elapsed, 5h 25m of budget remaining.
    Output:
    (none)
  99. 35m 00sobserve
    result
    Game time: 35m 10s elapsed, 5h 24m 50s of budget remaining.
    Program: farm (running).
    Inventory: hay 29, wood 727, carrot 111, pumpkin 864.
    Farm 6x6. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass, Tr=tree, Ca=carrot.
    y= 5  _Gr3  _Tr1  #--   #--   #Ca3  _Tr2
    y= 4  _T…
  100. 35m 10sdocs_read path="unlocks/fertilizer"
    result
    ## Fertilizer
    Grow plants instantly.
    
    use_item(Items.Fertilizer)
    
    ### Unlock Cost [Current cost: wood=500]
    Game time: 35m 20s elapsed, 5h 24m 40s of budget remaining.
  101. 35m 20sdocs_read path="unlocks/mazes"
    result
    ## Mazes
    A maze with a treasure in the middle.
    
    if get_entity_type() == Entities.Treasure:
        harvest()
    
    ### Unlock Cost [Current cost: weird_substance=1000]
    Game time: 35m 30s elapsed, 5h 24m 30s of budget remaining.
  102. 35m 30sdocs_read path="unlocks/megafarm"
    result
    ## Megafarm
    More drones!
    
    spawn_drone(task)
    
    ### Unlock Cost [Current cost: gold=2000]
    Game time: 35m 40s elapsed, 5h 24m 20s of budget remaining.
  103. 35m 40sthoughtHay has crashed to 29 since carrots eat hay, so I'll adjust odd-parity tiles to dynamically pick grass or carrots based on hay stock. I'm also buying fertilizer with 727 wood to unlock the mazes → gold → megafarm path.
  104. 35m 40sstop_program
    result
    Program stopped.
    Game time: 35m 50s elapsed, 5h 24m 10s of budget remaining.
  105. 35m 50sbuy_upgrade upgrades=["fertilizer"] · evidence
    result
    Bought fertilizer, now level 1. Paid wood 500. Its tutorial is docs page docs/unlocks/fertilizer.md.
    Game time: 36m elapsed, 5h 24m of budget remaining.
  106. 36m 00sdocs_read path="docs/unlocks/fertilizer.md"
    result
    # Fertilizer
    At some point, waiting for the plants to grow is just not efficient enough anymore. 
    Similar to water, you will automatically receive 1 fertilizer every 10 seconds, doubling with each upgrade.
    
    Fertilizer can make plants grow instantly. `use_item(Items.Fertilizer)` reduces the remaining growing time of the plant under the drone by 2 seconds.
    
    This has some side effects.
    Plants grown w…
  107. 36m 10swrite_program name="farm" · evidence
    result
    Saved farm (77 lines).
    Game time: 36m 20s elapsed, 5h 23m 40s of budget remaining.
  108. 36m 20srun_program name="farm" seconds=240
    result
    Ran farm for 4m of game time; it is still running.
    Inventory change: carrot -90, fertilizer -2, hay +298, pumpkin +627, water -4, weird_substance +93, wood +1428.
    Game time: 40m 30s elapsed, 5h 19m 30s of budget remaining.
    Output:
    (none)
  109. 40m 30sbuy_upgrade upgrades=["watering"] · evidence
    result
    Bought watering, now level 2. Paid wood 200. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 40m 40s elapsed, 5h 19m 20s of budget remaining.
  110. 40m 40sbuy_upgrade upgrades=["grass","debug","speed"] · evidence
    result
    Bought grass, now level 2. Paid hay 300.
    Could not buy debug: Not enough resources.
    Could not buy speed: Not enough resources.
    Game time: 40m 50s elapsed, 5h 19m 10s of budget remaining.
  111. 40m 50sresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; available, not affordable
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 2/10; cost wood 1250; can buy now; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrot…
  112. 41m 00ssaidBuying expand (8x8) and grass level 3, and raising the pumpkin-round carrot threshold so carrots accumulate for the speed upgrade (500 carrots).
  113. 41m 00sbuy_upgrade upgrades=["expand","grass"] · evidence
    result
    Bought expand, now level 5. Paid pumpkin 1000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Bought grass, now level 3. Paid wood 500.
    Game time: 41m 10s elapsed, 5h 18m 50s of budget remaining.
  114. 41m 10sstop_program
    result
    Program stopped.
    Game time: 41m 20s elapsed, 5h 18m 40s of budget remaining.
  115. 41m 20swrite_program name="farm" · evidence
    result
    Saved farm (80 lines).
    Game time: 41m 30s elapsed, 5h 18m 30s of budget remaining.
  116. 41m 30srun_program name="farm" seconds=300
    result
    Ran farm for 5m of game time; it is still running.
    Inventory change: carrot +293, fertilizer -2, hay +210, water -4, weird_substance +71, wood +2473.
    Game time: 46m 40s elapsed, 5h 13m 20s of budget remaining.
    Output:
    (none)
  117. 46m 40sbuy_upgrade upgrades=["carrots","fertilizer"] · evidence
    result
    Bought carrots, now level 3. Paid wood 1250. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought fertilizer, now level 2. Paid wood 1500. Its tutorial is docs page docs/unlocks/fertilizer.md.
    Game time: 46m 50s elapsed, 5h 13m 10s of budget remaining.
  118. 46m 50sobserve
    result
    Game time: 47m elapsed, 5h 13m of budget remaining.
    Program: farm (running).
    Inventory: hay 397, wood 1189, carrot 456, pumpkin 491, weird_substance 193, water 1.
    Farm 8x8. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Gr=grass, Tr=tree, Ca=carrot.
    y= 7  _Gr3  _Tr3  #Ca3  _…
  119. 47m 00swait seconds=120 until_resources={"carrot":500}
    result
    Waited 26s (carrot reached 500). Program: farm running.
    Inventory change: carrot +44, fertilizer -1, hay +12, water -1, weird_substance +6, wood +137.
    Game time: 47m 37s elapsed, 5h 12m 23s of budget remaining.
  120. 47m 37sbuy_upgrade upgrades=["speed","trees"] · evidence
    result
    Bought speed, now level 4. Paid carrot 500. Its tutorial is docs page docs/unlocks/speed.md.
    Bought trees, now level 2. Paid hay 300. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 47m 47s elapsed, 5h 12m 13s of budget remaining.
  121. 47m 47ssaidSpeed 4 and trees 2 bought. Next: debug (cheap, unlocks timing path), then wait for 500 carrots for sunflowers.
  122. 47m 47sbuy_upgrade upgrades=["debug"] · evidence
    result
    Bought debug, now level 1. Paid hay 50, wood 50. Its tutorial is docs page docs/scripting/debug.md.
    Game time: 47m 57s elapsed, 5h 12m 3s of budget remaining.
  123. 47m 57swait seconds=300 until_resources={"carrot":500}
    result
    Waited 2m 34s (carrot reached 500). Program: farm running.
    Inventory change: carrot +484, hay +252, weird_substance +194, wood +3680.
    Game time: 50m 40s elapsed, 5h 9m 20s of budget remaining.
  124. 50m 40sbuy_upgrade upgrades=["sunflowers","watering"] · evidence
    result
    Bought sunflowers, now level 1. Paid carrot 500. Its tutorial is docs page docs/unlocks/sunflowers.md.
    Bought watering, now level 3. Paid wood 800. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 50m 50s elapsed, 5h 9m 10s of budget remaining.
  125. 50m 50sdocs_read path="docs/unlocks/sunflowers.md"
    result
    # Sunflowers
    [Sunflowers](objects/sunflower) collect the power of the sun. You can harvest that power. 
    
    Planting them works exactly like planting carrots or pumpkins. 
    
    Harvesting a grown sunflower yields power.
    If there are at least 10 sunflowers on the farm and you harvest the one with the largest number of petals you get `8` times more power!
    If you harvest a sunflower while there is another s…
  126. 51m 00sdocs_read path="objects/sunflower"
    result
    ## Sunflower
    Sunflowers collect the power from the sun. Harvesting them will give you Items.Power.
    If you harvest a sunflower with the maximum number of petals you get bonus power.
    
    Base growth time between 5.6 and 8.4 seconds.
    Can grow on soil.
    
    ### Plant Cost [Current cost: carrot=1]
    
    For more related information see: [Sunflowers](docs/unlocks/sunflowers.md)
    Game time: 51m 10s elapsed, 5h 8m 50s…
  127. 51m 10sresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; available, not affordable
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 3/10; cost wood 6250; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and …
  128. 51m 20ssaidPlan: buy grass 4 (2500 wood); add a sunflower round (power doubles drone speed) to the farm program; lower pumpkin threshold later after lists. Writing the program now alongside the purchase.
  129. 51m 20sbuy_upgrade upgrades=["grass"] · evidence
    result
    Bought grass, now level 4. Paid wood 2500.
    Game time: 51m 30s elapsed, 5h 8m 30s of budget remaining.
  130. 51m 30sstop_program
    result
    Program stopped.
    Game time: 51m 40s elapsed, 5h 8m 20s of budget remaining.
  131. 51m 40swrite_program name="farm" · evidence
    result
    Saved farm (115 lines).
    Game time: 51m 50s elapsed, 5h 8m 10s of budget remaining.
  132. 51m 50srun_program name="farm" seconds=120
    result
    Ran farm for 2m of game time; it is still running.
    Inventory change: carrot +98, fertilizer -4, power +348.81, water -8, weird_substance +171, wood +929.
    Game time: 54m elapsed, 5h 6m of budget remaining.
    Output:
    (none)
  133. 54m 00sobserve
    result
    Game time: 54m 10s elapsed, 5h 5m 50s of budget remaining.
    Program: farm (running).
    Inventory: hay 423, wood 5296, carrot 486, pumpkin 491, weird_substance 725, power 342.06.
    Farm 8x8. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Ca=carrot, Tr=tree, Gr=grass.
    y= 7  #Ca3  _…
  134. 54m 10swait seconds=300 until_resources={"carrot":500}
    result
    Waited 0s (carrot reached 518). Program: farm running.
    Inventory change: no change.
    Game time: 54m 20s elapsed, 5h 5m 40s of budget remaining.
  135. 54m 20ssaidBuying lists (500 carrots) and watering 4 (3200 wood); reading lists docs in parallel. After that I'll lower the pumpkin threshold.
  136. 54m 20sbuy_upgrade upgrades=["lists","watering"] · evidence
    result
    Bought lists, now level 1. Paid carrot 500. Its tutorial is docs page docs/scripting/lists.md.
    Bought watering, now level 4. Paid wood 3200. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 54m 30s elapsed, 5h 5m 30s of budget remaining.
  137. 54m 30sdocs_read path="docs/scripting/lists.md"
    result
    # Lists
    Lists are an easy way to store multiple values in a single variable.
    You can create new lists like this:
    
    `some_list = [2, True, Items.Hay]`
    
    The list now contains the values `2`, `True` and `Items.Hay`.
    A list can also be empty:
    
    `empty_list = []`
    
    You can access an element of a list by its index. The index is `0` for the first element, `1` for the second element, `2` for the third...
    
    pl…
  138. 54m 40sstop_program
    result
    Program stopped.
    Game time: 54m 50s elapsed, 5h 5m 10s of budget remaining.
  139. 54m 50swrite_program name="farm" · evidence
    result
    Saved farm (115 lines).
    Game time: 55m elapsed, 5h 5m of budget remaining.
  140. 55m 00srun_program name="farm" seconds=300
    result
    Ran farm for 5m of game time; it is still running.
    Inventory change: carrot +134, fertilizer -4, hay +28, power +218.54, pumpkin +2244, water -16, weird_substance +330, wood +2834.
    Game time: 1h 10s elapsed, 4h 59m 50s of budget remaining.
    Output:
    (none)
  141. 1h 00msaidPumpkins ~2700, weird substance ~1050. Buying mazes, timing, and utilities, and reading the mazes tutorial.
  142. 1h 00mbuy_upgrade upgrades=["mazes","timing","utilities"] · evidence
    result
    Bought mazes, now level 1. Paid weird_substance 1000. Its tutorial is docs page docs/unlocks/mazes.md.
    Bought timing, now level 1. Paid pumpkin 1000. Its tutorial is docs page docs/unlocks/timing.md.
    Bought utilities, now level 1. Paid pumpkin 1000.
    Game time: 1h 20s elapsed, 4h 59m 40s of budget remaining.
  143. 1h 00mdocs_read path="docs/unlocks/mazes.md"
    result
    # Mazes
    `Items.Weird_Substance`, which is obtained by [fertilizing](docs/unlocks/fertilizer.md) plants, has a strange effect on bushes. If the drone is over a bush and you call `use_item(Items.Weird_Substance, amount)` the bush will grow into a maze of hedges.
    The size of the maze depends on the amount of `Items.Weird_Substance` used (the second argument of the `use_item()` call).
    Without maze upg…
  144. 1h 00mdocs_read path="docs/unlocks/timing.md"
    result
    # Timing
    If you really want to optimize your methods you need to understand how time is measured in this game. This unlock is all about that.
    
    ## New Functions
    There are two useful functions to measure how long things take:
    
    `get_time()` returns the time in seconds since the start of the game.
    
    `get_tick_count()` returns the number of ticks performed since the start of execution.
    
    These two functi…
  145. 1h 00mthoughtI'll switch to a maze mode to accumulate gold toward the 2000-gold megafarm, while keeping pumpkin/carrot production going for the level 2 pumpkins, speed, and polyculture goals. Writing the maze mode logic into the farm program now.
  146. 1h 00mstop_program
    result
    Program stopped.
    Game time: 1h 50s elapsed, 4h 59m 10s of budget remaining.
  147. 1h 00mdocs_read path="functions/can_move"
    result
    can_move(direction)
    Checks if the drone can move in the specified direction.
    
    returns True if the drone can move, False otherwise.
    
    takes 1 tick to execute.
    
    example:
    if can_move(North):
        move(North)
    
    For more related information see: [Mazes](docs/unlocks/mazes.md)
    Game time: 1h 1m elapsed, 4h 59m of budget remaining.
  148. 1h 01mwrite_program name="farm" · evidence
    result
    Saved farm (154 lines).
    Game time: 1h 1m 10s elapsed, 4h 58m 50s of budget remaining.
  149. 1h 01mrun_program name="farm" seconds=90
    result
    Ran farm for 1m 30s of game time; it is still running.
    Inventory change: carrot +220, fertilizer -2, gold +1216, hay +328, power -60.68, water -10, weird_substance -13, wood +327.
    Game time: 1h 2m 50s elapsed, 4h 57m 10s of budget remaining.
    Output:
    (none)
  150. 1h 02msaidGold is flowing fast from mazes (+1216 in 90s). Waiting for 2000 gold, then buying megafarm.
  151. 1h 02mwait seconds=300 until_resources={"gold":2000}
    result
    Waited 24s (gold reached 2048). Program: farm running.
    Inventory change: fertilizer +4, gold +512, power -16.06, water +19, weird_substance -56.
    Game time: 1h 3m 24s elapsed, 4h 56m 36s of budget remaining.
  152. 1h 03mbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Bought megafarm, now level 1. Paid gold 2000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Game time: 1h 3m 34s elapsed, 4h 56m 26s of budget remaining.
  153. 1h 03mdocs_read path="docs/unlocks/megafarm.md"
    result
    # Mega Farm
    This incredibly powerful unlock gives you access to multiple drones. 
    
    As before, you still start with just one drone. Additional drones must first be spawned and will disappear after the program terminates.
    Each drone runs its own separate program. New drones can be spawned using the `spawn_drone(function)` function.
    
    `def drone_function():
        move(North)
        do_a_flip()
    
    spawn_drone…
  154. 1h 03mdocs_read path="functions/spawn_drone"
    result
    spawn_drone(function, *args)
    Spawns a new drone in the same position as the drone that ran the spawn_drone(function, *args) command. The new drone then begins executing the specified function. The rest of the arguments are copied and passed into the specified function. After the drone is done, it will disappear automatically.
    
    returns the handle of the new drone or None if all drones are already s…
  155. 1h 03mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; available, not affordable
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 3/10; cost wood 6250; can buy now; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrot…
  156. 1h 04mstop_program
    result
    Program stopped.
    Game time: 1h 4m 14s elapsed, 4h 55m 46s of budget remaining.
  157. 1h 04msaidMegafarm gives 2 drones now (next level: 8000 gold → 4). Rewriting the farm program for multi-drone column workers, with a gold target of 8000.
  158. 1h 04mwrite_program name="farm" · evidence
    result
    Saved farm (204 lines).
    Game time: 1h 4m 24s elapsed, 4h 55m 36s of budget remaining.
  159. 1h 04mrun_program name="farm" seconds=180
    result
    Ran farm for 3m of game time; it is still running.
    Inventory change: fertilizer +36, power -242.86, water +144.
    Game time: 1h 7m 34s elapsed, 4h 52m 26s of budget remaining.
    Output:
    (none)
  160. 1h 07msaidNothing produced in 3 minutes — something is stuck. Checking the farm state.
  161. 1h 07mobserve
    result
    Game time: 1h 7m 44s elapsed, 4h 52m 16s of budget remaining.
    Program: farm (running).
    Inventory: hay 727, wood 7393, carrot 261, pumpkin 2202, weird_substance 49, gold 112, water 171, fertilizer 43, power 132.82.
    Farm 8x8. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: He=h…
  162. 1h 07mobserve
    result
    Game time: 1h 7m 54s elapsed, 4h 52m 6s of budget remaining.
    Program: farm (running).
    Inventory: hay 727, wood 7393, carrot 261, pumpkin 2202, weird_substance 49, gold 112, water 179, fertilizer 45, power 119.32.
    Farm 8x8. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: He=he…
  163. 1h 07mthoughtFound the issue: the drone got stuck because the previous program was stopped mid-maze, causing the new program's `goto` loop to run endlessly against a hedge wall. I'll fix this by detecting any leftover maze at the start of the loop and solving it first.
  164. 1h 07mstop_program
    result
    Program stopped.
    Game time: 1h 8m 4s elapsed, 4h 51m 56s of budget remaining.
  165. 1h 08mwrite_program name="farm" · evidence
    result
    Saved farm (212 lines).
    Game time: 1h 8m 14s elapsed, 4h 51m 46s of budget remaining.
  166. 1h 08mrun_program name="farm" seconds=180
    result
    Ran farm for 3m of game time; it is still running.
    Inventory change: carrot +116, fertilizer -48, gold +2176, hay +192, power +94.04, water -176, weird_substance +107, wood +249.
    Game time: 1h 11m 24s elapsed, 4h 48m 36s of budget remaining.
    Output:
    (none)
  167. 1h 11msaidWorking again: +2176 gold, sunflowers replenished power. Buying carrots level 4 (6250 wood) and letting it run.
  168. 1h 11mbuy_upgrade upgrades=["carrots"] · evidence
    result
    Bought carrots, now level 4. Paid wood 6250. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 1h 11m 34s elapsed, 4h 48m 26s of budget remaining.
  169. 1h 11mwait seconds=300
    result
    Waited 5m (time up). Program: farm running.
    Inventory change: carrot -213, fertilizer -7, gold +2304, hay -496, power +53.17, pumpkin +4134, water -32, weird_substance -101, wood -77.
    Game time: 1h 16m 44s elapsed, 4h 43m 16s of budget remaining.
  170. 1h 16mobserve
    result
    Game time: 1h 16m 54s elapsed, 4h 43m 6s of budget remaining.
    Program: farm (running).
    Inventory: hay 399, wood 1528, carrot 284, pumpkin 6336, weird_substance 46, gold 4912, power 225.99.
    Farm 8x8. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Ca=carrot, Tr=tree, Gr=grass.…
  171. 1h 16mdocs_read path="unlocks/polyculture"
    result
    ## Polyculture
    Use companion planting to increase the yield.
    
    plant_type, (x, y) = get_companion()
    
    ### Unlock Cost [Current cost: pumpkin=3000]
    Game time: 1h 17m 4s elapsed, 4h 42m 56s of budget remaining.
  172. 1h 17mdocs_read path="objects/carrot"
    result
    ## Carrot
    Carrots!
    
    Base growth time between 4.8 and 7.2 seconds.
    Can grow on soil.
    
    ### Plant Cost [Current cost: hay=8, wood=8]
    
    For more related information see: [Carrots](docs/unlocks/carrots.md)
    Game time: 1h 17m 14s elapsed, 4h 42m 46s of budget remaining.
  173. 1h 17mwait seconds=600 until_resources={"pumpkin":8000}
    result
    Waited 2m 15s (pumpkin reached 8205). Program: farm running.
    Inventory change: carrot +42, gold +1088, power +270.48, pumpkin +1113, weird_substance -28, wood -61.
    Game time: 1h 19m 40s elapsed, 4h 40m 20s of budget remaining.
  174. 1h 19msaidBuying expand (12x12) now; the program sizes itself from `get_world_size()` so it adapts.
  175. 1h 19mbuy_upgrade upgrades=["expand"] · evidence
    result
    Bought expand, now level 6. Paid pumpkin 8000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Game time: 1h 19m 50s elapsed, 4h 40m 10s of budget remaining.
  176. 1h 19mwait seconds=300
    result
    Waited 5m (time up). Program: farm running.
    Inventory change: carrot +5, fertilizer +8, gold +1440, power +598.77, pumpkin +3367, weird_substance +19, wood +610.
    Game time: 1h 25m elapsed, 4h 35m of budget remaining.
  177. 1h 25mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Bought polyculture, now level 1. Paid pumpkin 3000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game time: 1h 25m 10s elapsed, 4h 34m 50s of budget remaining.
  178. 1h 25mdocs_read path="docs/unlocks/polyculture.md"
    result
    # Polyculture
    You may have already noticed that sometimes plants yield more when planted together.
    Grass, bushes, trees, and carrots yield more when they have the right plant companion. Companion preference is different for each individual plant and cannot be predicted. Fortunately, the companion preference of the plant under the drone can be measured using `get_companion()`. It returns a tuple wh…
  179. 1h 25mobserve
    result
    Game time: 1h 25m 30s elapsed, 4h 34m 30s of budget remaining.
    Program: farm (running).
    Inventory: hay 447, wood 3797, carrot 205, pumpkin 572, weird_substance 293, gold 7440, power 1159.68.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entities: Ca=carrot, Tr=tree, Gr=gr…
  180. 1h 25mwait seconds=300 until_resources={"gold":8000}
    result
    Waited 21s (gold reached 8016). Program: farm running.
    Inventory change: fertilizer +5, gold +432, power -14.45, water +17, weird_substance -24.
    Game time: 1h 26m 1s elapsed, 4h 33m 59s of budget remaining.
  181. 1h 26msaidGold hit 8000 — buying megafarm level 2 (4 drones) and checking the next costs. Then I'll raise the pumpkin threshold so carrots accumulate for speed 5 and pumpkins 2 (1000 each).
  182. 1h 26mbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Bought megafarm, now level 2. Paid gold 8000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Game time: 1h 26m 11s elapsed, 4h 33m 49s of budget remaining.
  183. 1h 26mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 0/6; cost pumpkin 5000; available, not affordable
      ## Cactus Cactus! plant(Entities.Cactus)
    carrots (Carrots) level 4/10; cost wood 31200; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and…
  184. 1h 26mstop_program
    result
    Program stopped.
    Game time: 1h 26m 31s elapsed, 4h 33m 29s of budget remaining.
  185. 1h 26msaidNext steps: set PUMP_AT=1200 (accumulate carrots for speed 5 / pumpkins 2), GOLD_AT=40000 (toward 8 drones), then run. Write and run are sequential, so writing first.
  186. 1h 26mwrite_program name="farm" · evidence
    result
    Saved farm (212 lines).
    Game time: 1h 26m 41s elapsed, 4h 33m 19s of budget remaining.
  187. 1h 26mrun_program name="farm" seconds=300
    result
    Ran farm for 5m of game time; it is still running.
    Inventory change: carrot +1856, fertilizer +15, gold +4752, hay +720, power -234.38, water +60, weird_substance +265, wood +273.
    Game time: 1h 31m 51s elapsed, 4h 28m 9s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- mixed_tile <- ensure <- fert
    use_item(Items.Fertilizer)
            ^^ …
  188. 1h 31msaidCarrots hit ~2060 — buying speed 5 and pumpkins 2 together now.
  189. 1h 31mbuy_upgrade upgrades=["speed","pumpkins"] · evidence
    result
    Bought speed, now level 5. Paid carrot 1000. Its tutorial is docs page docs/unlocks/speed.md.
    Bought pumpkins, now level 2. Paid carrot 1000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Game time: 1h 32m 1s elapsed, 4h 27m 59s of budget remaining.
  190. 1h 32mstop_program
    result
    Program stopped.
    Game time: 1h 32m 11s elapsed, 4h 27m 49s of budget remaining.
  191. 1h 32mthoughtI'll set PUMP_AT to roughly 600 to reflect the higher carrot cost of pumpkins, then rerun before accumulating pumpkins for the cactus (5000) and dictionaries (2500). For now I can only make the write change; the run depends on it finishing first.
  192. 1h 32mwrite_program name="farm" · evidence
    result
    Saved farm (212 lines).
    Game time: 1h 32m 21s elapsed, 4h 27m 39s of budget remaining.
  193. 1h 32mrun_program name="farm" seconds=600
    result
    Ran farm for 10m of game time; it is still running.
    Inventory change: carrot +1098, fertilizer -14, gold +15552, hay +352, power -684.16, pumpkin +1428, water -60, weird_substance -303, wood +303.
    Game time: 1h 42m 31s elapsed, 4h 17m 29s of budget remaining.
    Output:
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- pump_tile <- water
    use_item(Items.Water)
            ^^   …
  194. 1h 42mobserve
    result
    Game time: 1h 42m 41s elapsed, 4h 17m 19s of budget remaining.
    Program: farm (running).
    Inventory: hay 2479, wood 3925, carrot 1159, pumpkin 2000, weird_substance 111, gold 21328, water 68, fertilizer 18, power 161.72.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone.
    Entitie…
  195. 1h 42msaidMaze mode is eating most of the drone time (gold 21k, 8 drones at 32k). Buying trees 3 with spare hay, then waiting for 32k gold.
  196. 1h 42mbuy_upgrade upgrades=["trees"] · evidence
    result
    Bought trees, now level 3. Paid hay 1200. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 1h 42m 51s elapsed, 4h 17m 9s of budget remaining.
  197. 1h 42mwait seconds=900 until_resources={"gold":32000}
    result
    Waited 10m 41s (gold reached 32128). Program: farm running.
    Inventory change: carrot -784, fertilizer -21, gold +10368, hay -880, power +602.21, pumpkin +22026, water -80, weird_substance -16, wood +9666.
    Game time: 1h 53m 42s elapsed, 4h 6m 18s of budget remaining.
  198. 1h 53mbuy_upgrade upgrades=["megafarm","cactus","dictionaries","grass"] · evidence
    result
    Bought megafarm, now level 3. Paid gold 32000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Bought cactus, now level 1. Paid pumpkin 5000. Its tutorial is docs page docs/unlocks/cactus.md.
    Bought dictionaries, now level 1. Paid pumpkin 2500. Its tutorial is docs page docs/scripting/dicts.md.
    Bought grass, now level 5. Paid wood 12500.
    Game time: 1h 53m 52s elapsed, 4h 6m 8s of budget remain…
  199. 1h 53mdocs_read path="docs/unlocks/cactus.md"
    result
    # Cactus
    Like other plants, [cacti](objects/cactus) can be grown on soil and harvested as usual.
    
    However, they come in various sizes and have a strange sense of order.
    
    If you harvest a fully-grown cactus and all neighboring cacti are in sorted order, it will also harvest all neighboring cacti recursively.
    
    A cactus is considered to be in sorted order if all neighboring cacti to the `North` and `…
  200. 1h 54mdocs_read path="objects/cactus"
    result
    ## Cactus
    Cacti come in 10 different sizes. When harvested adjacent cacti that are "sorted" will also be harvested.
    
    Base growth time between 1 and 1 seconds.
    Can grow on soil.
    
    ### Plant Cost [Current cost: pumpkin=2]
    Game time: 1h 54m 12s elapsed, 4h 5m 48s of budget remaining.
  201. 1h 54mdocs_read path="unlocks/dinosaurs"
    result
    ## Dinosaurs
    Majestic ancient creatures.
    
    ### Unlock Cost [Current cost: cactus=2000]
    Game time: 1h 54m 22s elapsed, 4h 5m 38s of budget remaining.
  202. 1h 54mthoughtPlanting all 144 tiles with 2 pumpkins each and sorting rows then columns via swap lets me harvest 20,736 cactus in one go. I'll add a parallel cactus-sorting round across the 8 drones and trim maze time accordingly.
  203. 1h 54mstop_program
    result
    Program stopped.
    Game time: 1h 54m 32s elapsed, 4h 5m 28s of budget remaining.
  204. 1h 54mdocs_read path="functions/swap"
    result
    swap(direction)
    Swaps the entity under the drone with the entity next to the drone in the specified direction.
    Doesn't work on all entities.
    Also works if one (or both) of the entities are None.
    
    returns True if it succeeded, False otherwise.
    
    takes 200 ticks to execute on success, 1 tick otherwise.
    
    example:
    swap(North)
    
    For more related information see: [Cactus](docs/unlocks/cactus.md)
    Game time…
  205. 1h 54mdocs_read path="functions/measure"
    result
    measure(direction = None) 
    Can measure some values on some entities. The effect of this depends on the entity.
    
    If direction is not None it measures the neighboring entity in the given direction.
    
    returns the number of petals of a sunflower.
    returns the next position for a treasure or apple.
    returns the size of a cactus.
    returns a mysterious number for a pumpkin.
    returns None for all other entitie…
  206. 1h 54mwrite_program name="farm" · evidence
    result
    Saved farm (259 lines).
    Game time: 1h 55m 2s elapsed, 4h 4m 58s of budget remaining.
  207. 1h 55mrun_program name="farm" seconds=180
    result
    Ran farm for 3m of game time; it is still running.
    Inventory change: cactus +19944, fertilizer +25, gold +4896, power -282.14, pumpkin -288, water +102, weird_substance +384.
    Game time: 1h 58m 12s elapsed, 4h 1m 48s of budget remaining.
    Output:
    (none)
  208. 1h 58msaidCactus round worked: +19,944 cactus. Buying dinosaurs (2000) and mazes 2 (12000 cactus, doubles gold per maze), and reading the dinosaur docs.
  209. 1h 58mbuy_upgrade upgrades=["dinosaurs","mazes"] · evidence
    result
    Bought dinosaurs, now level 1. Paid cactus 2000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Bought mazes, now level 2. Paid cactus 12000. Its tutorial is docs page docs/unlocks/mazes.md.
    Game time: 1h 58m 22s elapsed, 4h 1m 38s of budget remaining.
  210. 1h 58mdocs_read path="docs/unlocks/dinosaurs.md"
    result
    # Dinosaurs
    Dinosaurs are ancient, majestic creatures that can be farmed for ancient bones.
    
    Unfortunately dinosaurs have gone extinct a long time ago, so the best we can do now is dressing up as one.
    For this purpose you have received the new dinosaur hat.
    
    The hat can be equipped with
    `change_hat(Hats.Dinosaur_Hat)`
    
    Unfortunately it doesn't quite look like on the advertisement...
    
    If you equip …
  211. 1h 58mobserve
    result
    Game time: 1h 58m 42s elapsed, 4h 1m 18s of budget remaining.
    Program: farm (running).
    Inventory: hay 2543, wood 965, carrot 1237, pumpkin 17960, cactus 5944, weird_substance 339, gold 7184, water 163, fertilizer 41, power 298.52.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a dr…
  212. 1h 58mbuy_upgrade upgrades=["hats"] · evidence
    result
    Could not buy hats: Already at maximum level.
  213. 1h 58mdocs_read path="objects/apple"
    result
    ## Apple
    Dinosaurs love them apparently.
    
    ### Plant Cost [Current cost: cactus=2]
    
    For more related information see: [Dinosaurs](docs/unlocks/dinosaurs.md)
    Game time: 1h 59m 2s elapsed, 4h 58s of budget remaining.
  214. 1h 59mdocs_read path="docs/unlocks/hats.md"
    result
    # Hats
    
    You have unlocked a few new hat colors for your drone.
    
    Equip them like this:
    `change_hat(Hats.Gray_Hat)
    do_a_flip()
    change_hat(Hats.Purple_Hat)
    do_a_flip()
    change_hat(Hats.Green_Hat)
    do_a_flip()
    change_hat(Hats.Brown_Hat)
    do_a_flip()`
    Game time: 1h 59m 12s elapsed, 4h 48s of budget remaining.
  215. 1h 59mthoughtApples only cost 2 cactus and hats are ready to use. I'll clear the farm, equip the gray hat at (0,0), fill the farm via a serpentine Hamiltonian path, then swap hats to collect tail² bones.
  216. 1h 59mstop_program
    result
    Program stopped.
    Game time: 1h 59m 22s elapsed, 4h 38s of budget remaining.
  217. 1h 59mwrite_program name="farm" · evidence
    result
    Saved farm (300 lines).
    Game time: 1h 59m 32s elapsed, 4h 28s of budget remaining.
  218. 1h 59mthoughtI'll run the program now, since the next steps depend on seeing its output.
  219. 1h 59mrun_program name="farm" seconds=240
    result
    Ran farm for 3m 55s of game time; it stopped with an error: Hats.Gray_Hat must be unlocked before this can be used.
    Inventory change: cactus -286, carrot -144, fertilizer -7, gold +4032, hay +2224, power +501.46, water -44, weird_substance -100.
    Game time: 2h 3m 37s elapsed, 3h 56m 23s of budget remaining.
    Output:
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    …
  220. 2h 03mthoughtI need to check which hat names are valid and the current state—fetching both now since they're independent.
  221. 2h 03mdocs_search query="Straw_Hat"
    result
    No matches for "Straw_Hat".
    Game time: 2h 3m 47s elapsed, 3h 56m 13s of budget remaining.
  222. 2h 03mdocs_read path="functions/change_hat"
    result
    change_hat(hat)
    Changes the hat of the drone to hat.
    
    returns None
    
    takes 200 ticks to execute.
    
    example:
    change_hat(Hats.Dinosaur_Hat)
    Game time: 2h 3m 57s elapsed, 3h 56m 3s of budget remaining.
  223. 2h 03mobserve
    result
    Game time: 2h 4m 7s elapsed, 3h 55m 53s of budget remaining.
    Program: none running.
    Inventory: hay 4767, wood 965, carrot 1093, pumpkin 17960, cactus 5658, weird_substance 95, gold 12944, water 191, fertilizer 52, power 759.34.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a drone…
  224. 2h 04mthoughtThe farm filled up with 143 apples eaten, but since Gray Hat isn't unlocked yet, the tail bones weren't collected. I'll write a small program to try the default straw hat for cashing in the tail and check the hats research entry.
  225. 2h 04mwrite_program name="hat" · evidence
    result
    Saved hat (2 lines).
    Game time: 2h 4m 17s elapsed, 3h 55m 43s of budget remaining.
  226. 2h 04mdocs_search query="Hats."
    result
    docs/home.md: …locks/fertilizer.md) [Functions](docs/scripting/functions.md) [Grass](unlocks/grass) [Hats](docs/unlocks/hats.md) [Import](docs/scripting/import.md) [Lists](docs/scripting/lists.md) [Loops](docs/scripting/while.md) [Mazes](docs/unlocks/mazes.md) [Megafarm](docs/unlocks/megafarm.m…
    docs/unlocks/dinosaurs.md: … dressing up as one. For this purpose you have received the new dinosaur ha…
  227. 2h 04mrun_program name="hat" seconds=10
    result
    Ran hat for 1s of game time; it finished.
    Inventory change: bone +20449, power -0.03, water +1.
    Game time: 2h 4m 38s elapsed, 3h 55m 22s of budget remaining.
    Output:
    20449
  228. 2h 04mthoughtCollected +20,449 bones. Next I'll fix the farm program to use `Hats.Straw_Hat` and purchase polyculture 2 with bones before rerunning.
  229. 2h 04mwrite_program name="farm" · evidence
    result
    Saved farm (300 lines).
    Game time: 2h 4m 48s elapsed, 3h 55m 12s of budget remaining.
  230. 2h 04mthoughtI'll buy polyculture 2 for 10k bones, restart the farm program, and check the updated research costs — doing all three at once since they're independent.
  231. 2h 04mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Bought polyculture, now level 2. Paid bone 10000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game time: 2h 4m 58s elapsed, 3h 55m 2s of budget remaining.
  232. 2h 04mrun_program name="farm" seconds=300
    result
    Ran farm for 5m of game time; it is still running.
    Inventory change: cactus +16056, fertilizer -5, gold +15264, power -414.63, pumpkin -288, water +96, weird_substance +3384.
    Game time: 2h 10m 8s elapsed, 3h 49m 52s of budget remaining.
    Output:
    (none)
  233. 2h 10mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 1/6; cost pumpkin 20000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 100% => 200%
    carrots (Carrots) level 4/10; cost wood 31200; available, not affordable; tutorial docs…
  234. 2h 10mthoughtI'll go ahead and get dinosaurs 2 (needs 12k cactus, doubles bone yield) and wait for pumpkins to hit 20k for cactus 2 — these are independent so I'm requesting both now.
  235. 2h 10mbuy_upgrade upgrades=["dinosaurs"] · evidence
    result
    Bought dinosaurs, now level 2. Paid cactus 12000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Game time: 2h 10m 28s elapsed, 3h 49m 32s of budget remaining.
  236. 2h 10mwait seconds=600 until_resources={"pumpkin":20000}
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: fertilizer +120, gold +24768, power -314.30, water +480, weird_substance -2064.
    Game time: 2h 20m 38s elapsed, 3h 39m 22s of budget remaining.
  237. 2h 20mthoughtMazes consumed the entire 10-minute cycle, netting only +24.8k gold. I'll limit mazes to a small batch per cycle and stop fertilizing cacti, but first I need to stop the program since the edit depends on it.
  238. 2h 20mstop_program
    result
    Program stopped.
    Game time: 2h 20m 48s elapsed, 3h 39m 12s of budget remaining.
  239. 2h 20mthoughtI'll update the farm program and buy trees 4 (if hay allows) now, then run the program afterward.
  240. 2h 20mwrite_program name="farm" · evidence
    result
    Saved farm (301 lines).
    Game time: 2h 20m 58s elapsed, 3h 39m 2s of budget remaining.
  241. 2h 20mbuy_upgrade upgrades=["trees"] · evidence
    result
    Could not buy trees: Not enough resources.
  242. 2h 21mthoughtI'll run the program now, since everything else depends on its results.
  243. 2h 21mrun_program name="farm" seconds=600
    result
    Ran farm for 10m of game time; it is still running.
    Inventory change: carrot -288, fertilizer -168, gold +19872, power +693.92, water -241, weird_substance -576.
    Game time: 2h 31m 18s elapsed, 3h 28m 42s of budget remaining.
    Output:
    (none)
  244. 2h 31mthoughtThe maze logic is dominating every loop since the elif chain keeps re-entering it; I'll fix it so each iteration runs a maze batch when due, then still does a farming round, and I'm stopping now to make that edit.
  245. 2h 31mstop_program
    result
    Program stopped.
    Game time: 2h 31m 28s elapsed, 3h 28m 32s of budget remaining.
  246. 2h 31mthoughtI'll write the fixed main loop and check the current inventory next, then run it once both are done.
  247. 2h 31mwrite_program name="farm" · evidence
    result
    Saved farm (301 lines).
    Game time: 2h 31m 38s elapsed, 3h 28m 22s of budget remaining.
  248. 2h 31mobserve
    result
    Game time: 2h 31m 48s elapsed, 3h 28m 12s of budget remaining.
    Program: none running.
    Inventory: hay 4767, wood 965, carrot 805, pumpkin 17672, cactus 9714, bone 10449, weird_substance 647, gold 75152, water 655, fertilizer 31, power 683.70.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); *…
  249. 2h 31mthoughtGold's at 75k, but wood and hay stalled since mazes ate up the time. Running the fixed program next—that's the key remaining step.
  250. 2h 31mrun_program name="farm" seconds=600
    result
    Ran farm for 10m of game time; it is still running.
    Inventory change: bone +40898, cactus +186052, carrot -288, fertilizer -1, gold +10656, hay +2304, power -272.28, pumpkin -2880, water -648, weird_substance -392.
    Game time: 2h 41m 58s elapsed, 3h 18m 2s of budget remaining.
    Output:
    Warning: Tried to use Items.Water but didn't have enough of it.
    In: worker <- water
    use_item(Items.Water)
            ^…
  251. 2h 41mthoughtCactus rounds are dominating gains while pumpkins stall out, so I'll switch the main loop to round-robin between pumpkins, mixed crops, cactus, and dino. I also need to buy affordable upgrades (trees 4, dinosaurs 3, mazes 3, polyculture 3) and pause the program to make these edits.
  252. 2h 41mbuy_upgrade upgrades=["trees","dinosaurs","mazes","polyculture"] · evidence
    result
    Bought trees, now level 4. Paid hay 4800. Its tutorial is docs page docs/unlocks/trees.md.
    Bought dinosaurs, now level 3. Paid cactus 72000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Bought mazes, now level 3. Paid cactus 72000. Its tutorial is docs page docs/unlocks/mazes.md.
    Bought polyculture, now level 3. Paid bone 50000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game t…
  253. 2h 42mstop_program
    result
    Program stopped.
    Game time: 2h 42m 18s elapsed, 3h 17m 42s of budget remaining.
  254. 2h 42mthoughtI'll write the round-robin version now, then run it once it's ready.
  255. 2h 42mwrite_program name="farm" · evidence
    result
    Saved farm (311 lines).
    Game time: 2h 42m 28s elapsed, 3h 17m 32s of budget remaining.
  256. 2h 42mthoughtI'll run the program next, since that's the remaining step needed.
  257. 2h 42mrun_program name="farm" seconds=600
    result
    Ran farm for 10m of game time; it is still running.
    Inventory change: fertilizer +120, power -377.52, pumpkin -168, water +432.
    Game time: 2h 52m 38s elapsed, 3h 7m 22s of budget remaining.
    Output:
    (none)
  258. 2h 52mthoughtNothing has been produced in 10 minutes, so something seems to be hung. I'll check the farm to see what's happening before deciding on a fix.
  259. 2h 52mobserve
    result
    Game time: 2h 52m 48s elapsed, 3h 7m 12s of budget remaining.
    Program: farm (running).
    Inventory: hay 2271, wood 965, carrot 517, pumpkin 14624, cactus 72458, bone 1347, weird_substance 255, gold 85808, water 487, fertilizer 162.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium, 3 full); * marks a dro…
  260. 2h 52mthoughtFound that the drone was stuck in a leftover dinosaur hat state from the interrupted run, causing `goto` to deadlock — fixing this by resetting the hat at program start and adding a fallback reset on repeated move failures. Stopping the program now so the edit can be applied.
  261. 2h 52mstop_program
    result
    Program stopped.
    Game time: 2h 52m 58s elapsed, 3h 7m 2s of budget remaining.
  262. 2h 52mthoughtI'll write the fixed program first, then run it once that's done.
  263. 2h 52mwrite_program name="farm" · evidence
    result
    Saved farm (319 lines).
    Game time: 2h 53m 8s elapsed, 3h 6m 52s of budget remaining.
  264. 2h 53mthoughtI'll run the program now and check back on its progress after it's had some time to execute.
  265. 2h 53mrun_program name="farm" seconds=300
    result
    Ran farm for 5m of game time; it is still running.
    Inventory change: bone +81992, cactus +61163, carrot -288, fertilizer -168, gold +6912, hay +10608, power +744.03, pumpkin -864, water -511, weird_substance -16, wood -960.
    Game time: 2h 58m 18s elapsed, 3h 1m 42s of budget remaining.
    Output:
    …------------------------------------------------------------
    Warning: Didn't have the required items to p…
  266. 2h 58mthoughtWood's run out since cactus/pump/dino rounds keep wiping trees before they regrow, so I'll switch to mixed sweeps in blocks of 4 and hold off on carrot planting until wood recovers. I'll stop the current run, update the script, then run it again in sequence.
  267. 2h 58mstop_program
    result
    Program stopped.
    Game time: 2h 58m 28s elapsed, 3h 1m 32s of budget remaining.
  268. 2h 58mthoughtI'll write the updated program now, then run it afterward.
  269. 2h 58mwrite_program name="farm" · evidence
    result
    Saved farm (316 lines).
    Game time: 2h 58m 38s elapsed, 3h 1m 22s of budget remaining.
  270. 2h 58mthoughtI'll run the program now, since the remaining checks depend on its output.
  271. 2h 58mrun_program name="farm" seconds=600
    result
    Ran farm for 10m of game time; it is still running.
    Inventory change: bone +163592, cactus +59920, carrot +53708, fertilizer -4, gold +21312, hay +29288, power +405.31, pumpkin +2550, water -19, weird_substance +8690, wood +177108.
    Game time: 3h 8m 48s elapsed, 2h 51m 12s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: mixed_block <- run_all <-…
  272. 3h 08mthoughtPolyculture 20x delivered a massive boost: +177k wood, +54k carrots, +164k bones in 10 minutes. Now I'll spend resources on upgrades (pumpkins, carrots, grass, fertilizer, watering, trees, plus polyculture and megafarm attempts) and refresh the research list in parallel.
  273. 3h 08mbuy_upgrade upgrades=["pumpkins","carrots","grass","fertilizer","watering","trees","polyculture","megafarm"] · evidence
    result
    Bought pumpkins, now level 3. Paid carrot 4000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Bought carrots, now level 5. Paid wood 31200. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought grass, now level 6. Paid wood 62500.
    Bought fertilizer, now level 3. Paid wood 9000. Its tutorial is docs page docs/unlocks/fertilizer.md.
    Bought watering, now level 5. Paid wood 12800. Its tutori…
  274. 3h 08mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 1/6; cost pumpkin 20000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 100% => 200%
    carrots (Carrots) level 5/10; cost wood 156000; available, not affordable; tutorial doc…
  275. 3h 09mthoughtI'll buy 4 pumpkins (16k carrots) and 6 waterings (51k wood) now, then let the farm run for about 10 minutes.
  276. 3h 09mbuy_upgrade upgrades=["pumpkins","watering"] · evidence
    result
    Bought pumpkins, now level 4. Paid carrot 16000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Bought watering, now level 6. Paid wood 51200. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 3h 9m 18s elapsed, 2h 50m 42s of budget remaining.
  277. 3h 09mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +163592, cactus +39184, carrot +198560, fertilizer -8, gold +21312, hay +71328, power -437.64, pumpkin +12984, water +203, weird_substance +50228, wood +863232.
    Game time: 3h 19m 28s elapsed, 2h 40m 32s of budget remaining.
  278. 3h 19mthoughtI'll make a large upgrade purchase (expanding the megafarm's drones and crop types) and check the current state at the same time, since these can run independently.
  279. 3h 19mbuy_upgrade upgrades=["megafarm","polyculture","carrots","grass","trees","pumpkins","cactus","fertilizer","watering"] · evidence
    result
    Bought megafarm, now level 4. Paid gold 128000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Bought polyculture, now level 4. Paid bone 250000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Bought carrots, now level 6. Paid wood 156000. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought grass, now level 7. Paid wood 312000.
    Bought trees, now level 6. Paid hay 76800. Its tuto…
  280. 3h 19mobserve
    result
    Game time: 3h 19m 48s elapsed, 2h 40m 12s of budget remaining.
    Program: farm (running).
    Inventory: hay 15831, wood 215201, carrot 181809, pumpkin 12678, cactus 232725, bone 160523, weird_substance 58961, gold 10800, water 331, fertilizer 10, power 556.98.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medi…
  281. 3h 19mthoughtI just need to wait for the pumpkin count to hit 64k so the 16x16 expand can proceed — everything else depends on that.
  282. 3h 19mwait seconds=600 until_resources={"pumpkin":64000}
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +163592, cactus +80440, carrot +504656, fertilizer +61, gold +20736, hay +240288, power +381.96, pumpkin +25392, water +2488, weird_substance +283404, wood +1866512.
    Game time: 3h 29m 58s elapsed, 2h 30m 2s of budget remaining.
  283. 3h 29mthoughtI'll request both in parallel: buying carrots, pumpkins, grass, and watering, while also waiting for the 64k pumpkins since they're independent tasks.
  284. 3h 29mbuy_upgrade upgrades=["carrots","pumpkins","grass","watering"] · evidence
    result
    Bought carrots, now level 7. Paid wood 781000. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought pumpkins, now level 6. Paid carrot 256000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Could not buy grass: Not enough resources.
    Bought watering, now level 8. Paid wood 819000. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 3h 30m 8s elapsed, 2h 29m 52s of budget remain…
  285. 3h 30mwait seconds=600 until_resources={"pumpkin":64000}
    result
    Waited 1m 47s (pumpkin reached 64566). Program: farm running.
    Inventory change: bone +81796, cactus +40680, carrot +334752, fertilizer -94, gold +6912, hay +91136, power -399.81, pumpkin +26496, water +920, weird_substance +176176, wood +626512.
    Game time: 3h 32m 5s elapsed, 2h 27m 55s of budget remaining.
  286. 3h 32mthoughtI'll trigger the 16x16 auto-expand and then let it run for 10 minutes—these two steps don't depend on each other, so I'll request both now.
  287. 3h 32mbuy_upgrade upgrades=["expand"] · evidence
    result
    Bought expand, now level 7. Paid pumpkin 64000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Game time: 3h 32m 15s elapsed, 2h 27m 45s of budget remaining.
  288. 3h 32mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +260100, cactus +33338, carrot +1227680, fertilizer -6, gold +16384, hay +191232, power +391.36, pumpkin +45420, water +5444, weird_substance +401648, wood +2754160.
    Game time: 3h 42m 25s elapsed, 2h 17m 35s of budget remaining.
  289. 3h 42mthoughtI need to buy grass (8), trees (7), and pumpkins (7), and separately pause the program to raise MAZE_BATCH since unused substance has piled up to ~900k. I'll run both of these independent tasks now.
  290. 3h 42mbuy_upgrade upgrades=["grass","trees","pumpkins"] · evidence
    result
    Bought grass, now level 8. Paid wood 1560000.
    Bought trees, now level 7. Paid hay 307000. Its tutorial is docs page docs/unlocks/trees.md.
    Bought pumpkins, now level 7. Paid carrot 1020000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Game time: 3h 42m 35s elapsed, 2h 17m 25s of budget remaining.
  291. 3h 42mstop_program
    result
    Program stopped.
    Game time: 3h 42m 45s elapsed, 2h 17m 15s of budget remaining.
  292. 3h 42mthoughtI'll first update the code to use MAZE_BATCH=8, then run it afterward.
  293. 3h 42mwrite_program name="farm" · evidence
    result
    Saved farm (316 lines).
    Game time: 3h 42m 55s elapsed, 2h 17m 5s of budget remaining.
  294. 3h 42mthoughtI'll run the program for about 10 minutes next, then decide on purchases based on what accumulates.
  295. 3h 42mrun_program name="farm" seconds=600
    result
    Ran farm for 10m of game time; it is still running.
    Inventory change: cactus +130616, carrot +785536, fertilizer +189, gold +40960, hay +475200, power +363.58, pumpkin +94208, water +6079, weird_substance +364116, wood +4017920.
    Game time: 3h 53m 5s elapsed, 2h 6m 55s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- sun_plant_tile <- e…
  296. 3h 53mthoughtI'll purchase cactus 3 (80k pumpkins), dinosaurs 4 (432k cactus), and carrots 8 (3.9M wood), then let the game run for another 10 minutes.
  297. 3h 53mbuy_upgrade upgrades=["cactus","dinosaurs","carrots"] · evidence
    result
    Bought cactus, now level 3. Paid pumpkin 120000. Its tutorial is docs page docs/unlocks/cactus.md.
    Bought dinosaurs, now level 4. Paid cactus 432000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Bought carrots, now level 8. Paid wood 3910000. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 3h 53m 15s elapsed, 2h 6m 45s of budget remaining.
  298. 3h 53mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +520200, cactus +259280, carrot +2353600, fertilizer -152, gold +49152, hay +512768, power +151.46, pumpkin +93376, water +5318, weird_substance +996064, wood +5452384.
    Game time: 4h 3m 25s elapsed, 1h 56m 35s of budget remaining.
  299. 4h 03mthoughtNext I'll buy 8 pumpkins, 8 trees, and 9 watering cans (plus attempt 5 polyculture and 4 mazes), then run the simulation for another 10 minutes—I'll request both since they're independent.
  300. 4h 03mbuy_upgrade upgrades=["pumpkins","trees","watering","polyculture","mazes"] · evidence
    result
    Bought pumpkins, now level 8. Paid carrot 4100000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Bought trees, now level 8. Paid hay 1230000. Its tutorial is docs page docs/unlocks/trees.md.
    Bought watering, now level 9. Paid wood 3280000. Its tutorial is docs page docs/unlocks/watering.md.
    Could not buy polyculture: Not enough resources.
    Could not buy mazes: Not enough resources.
    Game time:…
  301. 4h 03mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +520200, cactus +258160, carrot +1696320, fertilizer -76, gold +32768, hay +407296, power -354.14, pumpkin -2048, water +13313, weird_substance +1730520, wood +6901568.
    Game time: 4h 13m 45s elapsed, 1h 46m 15s of budget remaining.
  302. 4h 13mthoughtI'll buy polyculture 5, mazes 4, and grass 9 now that they're affordable, and also observe to check which mode is running since pumpkins didn't increase this window.
  303. 4h 13mbuy_upgrade upgrades=["polyculture","mazes","grass"] · evidence
    result
    Bought polyculture, now level 5. Paid bone 1250000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Bought mazes, now level 4. Paid cactus 432000. Its tutorial is docs page docs/unlocks/mazes.md.
    Bought grass, now level 9. Paid wood 7810000.
    Game time: 4h 13m 55s elapsed, 1h 46m 5s of budget remaining.
  304. 4h 13mobserve
    result
    Game time: 4h 14m 5s elapsed, 1h 45m 55s of budget remaining.
    Program: farm (running).
    Inventory: hay 448655, wood 3671057, carrot 1665601, pumpkin 302370, cactus 170783, bone 456411, weird_substance 4016409, gold 182064, water 35974, fertilizer 7, power 1461.24.
    Farm 16x16. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small…
  305. 4h 14mthoughtI'll let it run for about 10 minutes, since purchases depend on what accumulates over that time.
  306. 4h 14mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +520200, cactus +258064, carrot +3118272, fertilizer +85, gold +61440, hay +1790720, power -1176.66, pumpkin -2048, water +13831, weird_substance +2981376, wood +13931968.
    Game time: 4h 24m 15s elapsed, 1h 35m 45s of budget remaining.
  307. 4h 24mthoughtI'll refresh the research costs, try purchasing 9 carrots and 4 cactus, and keep the farm running for another 10 minutes—all at once since these are independent actions.
  308. 4h 24mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 3/6; cost pumpkin 720000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 400% => 800%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutorial …
  309. 4h 24mbuy_upgrade upgrades=["carrots","cactus"] · evidence
    result
    Could not buy carrots: Not enough resources.
    Could not buy cactus: Not enough resources.
  310. 4h 24mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +520200, cactus -4080, carrot +3493184, fertilizer +149, gold +61440, hay +699776, power +186.01, pumpkin +177408, water +13914, weird_substance +940468, wood +15527296.
    Game time: 4h 34m 45s elapsed, 1h 25m 15s of budget remaining.
  311. 4h 34mthoughtI'll buy 9 carrots now that wood is at ~33M, and separately wait for pumpkins to hit 512k to trigger the 22x22 expansion—both can proceed independently.
  312. 4h 34mbuy_upgrade upgrades=["carrots"] · evidence
    result
    Bought carrots, now level 9. Paid wood 19500000. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 4h 34m 55s elapsed, 1h 25m 5s of budget remaining.
  313. 4h 34mwait seconds=600 until_resources={"pumpkin":512000}
    result
    Waited 6m 27s (pumpkin reached 654242). Program: farm running.
    Inventory change: cactus +262144, carrot +5864320, fertilizer -288, gold +57344, hay +1472000, power +484.83, pumpkin +176512, water +7856, weird_substance +3211544, wood +13383936.
    Game time: 4h 41m 32s elapsed, 1h 18m 28s of budget remaining.
  314. 4h 41mthoughtI'll buy the expand upgrade to 22x22 since we have enough pumpkins (654k ≥ 512k needed), then let it run for 10 minutes.
  315. 4h 41mbuy_upgrade upgrades=["expand"] · evidence
    result
    Bought expand, now level 8. Paid pumpkin 512000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Game time: 4h 41m 42s elapsed, 1h 18m 18s of budget remaining.
  316. 4h 41mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: cactus -688, carrot +6466560, fertilizer +343, gold +30976, hay +2014208, power -870.40, water +14110, weird_substance +1066688, wood +16273472.
    Game time: 4h 51m 52s elapsed, 1h 8m 8s of budget remaining.
  317. 4h 51mthoughtI'll buy 9 pumpkins and 9 trees now that they're affordable, check the farm's current state, and run the simulation for another 10 minutes.
  318. 4h 51mbuy_upgrade upgrades=["pumpkins","trees"] · evidence
    result
    Bought pumpkins, now level 9. Paid carrot 16400000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Bought trees, now level 9. Paid hay 4920000. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 4h 52m 2s elapsed, 1h 7m 58s of budget remaining.
  319. 4h 52mobserve
    result
    Game time: 4h 52m 12s elapsed, 1h 7m 48s of budget remaining.
    Program: farm (running).
    Inventory: hay 1505359, wood 43287729, carrot 4207937, pumpkin 142242, cactus 686175, bone 1496811, weird_substance 12215333, gold 409648, water 88245, fertilizer 376.
    Farm 22x22. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 mediu…
  320. 4h 52mwait seconds=600
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: cactus -4704, fertilizer +480, water +15360.
    Game time: 5h 2m 22s elapsed, 57m 38s of budget remaining.
  321. 5h 02mthoughtI'll check how the snake game is progressing to decide whether to let the current dino round finish or end it early.
  322. 5h 02mobserve
    result
    Game time: 5h 2m 32s elapsed, 57m 28s of budget remaining.
    Program: farm (running).
    Inventory: hay 1505359, wood 43287729, carrot 4207937, pumpkin 142242, cactus 681263, bone 1496811, weird_substance 12215333, gold 409648, water 104117, fertilizer 872.
    Farm 22x22. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 medium,…
  323. 5h 02msaidThe tail is ~370/484, so the dino round should finish in a few minutes (worth ~1.9M bones). Needed: wait, stopping early once bones jump. Single request.
  324. 5h 02mwait seconds=600 until_resources={"bone":3000000}
    result
    Waited 10m (time up). Program: farm running.
    Inventory change: bone +1325192, cactus +936320, carrot +4843164, fertilizer -688, gold +73568, hay -247808, power +355.34, pumpkin -3872, water +12948, weird_substance +9723180, wood +26108672.
    Game time: 5h 12m 42s elapsed, 47m 18s of budget remaining.
  325. 5h 12mthoughtI'll buy grass 10 (costing ~69M wood) and stop the program to prevent further dino rounds, since a 22x22 round takes ~20 min and could forfeit bones if unfinished by the deadline — then write and run the update.
  326. 5h 12mbuy_upgrade upgrades=["grass"] · evidence
    result
    Bought grass, now level 10. Paid wood 39100000.
    Game time: 5h 12m 52s elapsed, 47m 8s of budget remaining.
  327. 5h 12mstop_program
    result
    Program stopped.
    Game time: 5h 13m 2s elapsed, 46m 58s of budget remaining.
  328. 5h 13mthoughtNext I'll write the end-game program—no dino, with a cactus/pump/mixed rotation and maze batches—then run it afterward once it's done.
  329. 5h 13mwrite_program name="farm" · evidence
    result
    Saved farm (276 lines).
    Game time: 5h 13m 12s elapsed, 46m 48s of budget remaining.
  330. 5h 13mthoughtNext, I'll run the program, since the remaining checks depend on its output.
  331. 5h 13mrun_program name="farm" seconds=900
    result
    Ran farm for 15m of game time; it is still running.
    Inventory change: cactus +937024, carrot +7543224, fertilizer -224, gold +127776, hay +2785024, power +2581.01, pumpkin +677344, water +17690, weird_substance +3566032, wood +34993664.
    Game time: 5h 28m 22s elapsed, 31m 38s of budget remaining.
    Output:
    Warning: Tried to use Items.Fertilizer but didn't have enough of it.
    In: worker <- pump_tile <-…
  332. 5h 28mthoughtI'll buy cactus level 4 (720k pumpkins) and megafarm level 5 (512k gold for 32 drones), then run the simulation for another 15 minutes since these purchases are independent.
  333. 5h 28mbuy_upgrade upgrades=["cactus","megafarm"] · evidence
    result
    Bought cactus, now level 4. Paid pumpkin 720000. Its tutorial is docs page docs/unlocks/cactus.md.
    Bought megafarm, now level 5. Paid gold 512000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Game time: 5h 28m 32s elapsed, 31m 28s of budget remaining.
  334. 5h 28mwait seconds=900
    result
    Waited 15m (time up). Program: farm running.
    Inventory change: cactus +3748096, carrot +12191616, fertilizer +209, gold +154880, hay +5776384, power -2762.44, pumpkin +671104, water +19057, weird_substance +5376640, wood +62697344.
    Game time: 5h 43m 42s elapsed, 16m 18s of budget remaining.
  335. 5h 43mthoughtI'll buy 10 carrots (~127M wood) and 5 mazes (cactus), then use up most of the remaining time—requesting both now since they're independent.
  336. 5h 43mbuy_upgrade upgrades=["carrots","mazes"] · evidence
    result
    Bought carrots, now level 10. Paid wood 97700000. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought mazes, now level 5. Paid cactus 2590000. Its tutorial is docs page docs/unlocks/mazes.md.
    Game time: 5h 43m 52s elapsed, 16m 8s of budget remaining.
  337. 5h 43mwait seconds=900
    result
    Waited 15m (time up). Program: farm running.
    Inventory change: cactus +1874048, carrot +25240348, fertilizer +46, gold +263296, hay +2144768, pumpkin +654272, water +18873, weird_substance +3031228, wood +64317568.
    Game time: 5h 59m 2s elapsed, 58s of budget remaining.
  338. 5h 59msaidAbout a minute of game time remains — I'll let it run out with the farm program still producing, then take a final snapshot.
  339. 5h 59mwait seconds=40
    result
    Waited 40s (time up). Program: farm running.
    Inventory change: fertilizer +32, gold +15488, water +1024, weird_substance -704.
    Game time: 5h 59m 52s elapsed, 8s of budget remaining.
  340. 5h 59msaidThe budget is used up (8s left, program still running). Final summary of the run: ## Result Farm: 22x22, 32 drones, speed maxed, all core upgrades bought (grass 10, carrots 10, trees 9, pumpkins 9, cactus 4, dinosaurs 4, mazes 5, polyculture 5, watering 9, fertilizer 4, megafarm 5). Resources produced (approximate final inventory, after heavy spending on upgrades): | Resource | Amount | |---|---| | Wood | ~160M | | Carrot | ~70M | | Weird substance | ~34M | | Hay | ~18M | | Cactus | ~7M | | Bone | ~2.8M | | Pumpkin | ~1.5M | | Gold | ~0.5M | | Power, water, fertilizer | produced and consumed continuously | ## How it worked - Early game: straight-line harvests → `can_harvest()` loop → bushes → carrots/trees checkerboard with hay-aware grass/carrot switching. - Mid game: a single mode-switching program (`farm`) with rounds for giant pumpkins, sunflower power (8x-petal harvesting), mazes for gold (wall-following), then multi-drone column workers once megafarm unlocked. - Late game: cactus rounds (plant all, parallel row/column bubble sort with `swap`, one harvest → n² cactus), dinosaur rounds (Hamiltonian-cycle snake for tail² bones), and polyculture, which multiplied tree/carrot/grass yields enormously. The main loop ran a fixed rotation (cactus → mixed block → pumpkin → mixed block) with maze batches each cycle. ## Mistakes worth noting - Stopping the program mid-maze or mid-dinosaur left the drone in a stuck state twice (hedge walls / dinosaur hat); fixed by resetting the hat at startup and making `goto` self-recover. - Mazes dominated drone time for ~20 minutes until I capped them per cycle. - Rounds that wipe the field destroyed unripe trees, starving wood until I grouped mixed sweeps into blocks of 4.
  341. 5h 59msaidWith 8 seconds left, the most useful thing is to let the farm program keep running to the final tick rather than spend the time on any other action.
  342. 5h 59mwait seconds=8
    result
    Waited 0s (time up). Program: farm running.
    Inventory change: no change.
    Game time: 6h elapsed, 0s of budget remaining. The game-time budget is used up. The run is over; stop now.
  343. 6h 00msaidThe budget is fully consumed — 6h elapsed, 0s remaining — and the game reports the run is over. There is nothing further to request: every remaining action would need game time that no longer exists, so no tool calls are warranted. Final state stands as summarized above: a 22x22 farm with 32 drones, maxed speed, and most upgrade tracks at or near their top levels, producing wood (~160M), carrots (~70M), weird substance (~34M), hay (~18M), cactus (~7M), bones (~2.8M), pumpkins (~1.5M), gold (~0.5M), plus continuous power, water, and fertilizer.

Thinking is shown as the agent reported it over ACP; some agents report a summary, not the full reasoning. Tool results are cut at 400 characters; program code is in evidence.json.

spentreported alongside the score, never folded into it

What it spent

API-equivalent cost (estimate)agent-session (one point per model request)

API-equivalent estimate at list prices; not an actual charge

Tokens

Input (uncached)6,231
Cache reads15,595,267
Cache writes226,215
Output113,467
Thinking (subset of output where reported)46,895
Total15,941,180
ModelTokensEstimate
claude-fable-5-115,939,762$14.14
claude-haiku-5-51,418$0.00015

Estimate: API-equivalent estimate at list prices; not an actual charge. Price table prices-2026-10-16b. The agent itself reported $14.14 (cost reported by the agent itself; plan or subscription billing may differ).

conditionsprovenance

Limitations

  • Recorded from a harness checkout with uncommitted changes.
Run ideconomy-v1-claude-fable-s3-a1-20261017T184247Z
Taskeconomy-v1 · acb5fb455a43
Budget6h 00m game time · 10s per action · caps: 2,000 tool calls, 20 continuations, 4h 00m real time
AgentClaude Agent 0.91.0 (@agentclientprotocol/claude-agent-acp)
Applied config{"model":"fable","effort":"medium","fast":"absent"}
Models reportedclaude-fable-5-1, claude-haiku-5-5
Tools availablebuy_upgrade, docs_list, docs_read, docs_search, inspect_tile, list_programs, observe, research, run_program, stop_program, wait, write_program
Harnesscd417a33b3bf (uncommitted changes)
Bridge / gameae01202f355c / 953fea25964f
Adaptersclaude-agent-acp 0.91.0, codex-acp 2.2.2, acp-sdk 1.8.0, mcp-sdk 1.32.1
Rubrics
economy-v1 (headline) · Σ over resources of log10(1 + produced) · 51746c5bec27
economy-weighted-v1 · scores 8.25 · log10(1 + Σ w_r × produced_r), weights from late-game sink prices · 228b39065cbd
Started / ended2026-10-17T18:42:47.776Z → 2026-10-17T19:10:32.163Z
Evidence89 items in evidence.json