Gemini 4 Argon, seed 2

Cursor · medium reasoning effort

ValidCounts toward the meanGame-time budget used

  • Hay 423m produced, 8.63 points
  • Wood 575m produced, 8.76 points
  • Carrot 562m produced, 8.75 points
  • Pumpkin 415m produced, 8.62 points
  • Cactus 415m produced, 8.62 points
  • Power 220k produced, 5.34 points
  • Bone 70.4m produced, 7.85 points
  • Weird substance 491m produced, 8.69 points
  • Gold 51.7m produced, 7.71 points
  • Water 357k produced, 5.55 points
  • Fertilizer 14.8k produced, 4.17 points

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

Score · economy-v1
82.69orders of magnitude · model mean 84.01
On seed 2
#1of 15 models
Cost
$4.30API-equivalent estimate
Real time
33m 04swall 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 00m35.5
2h 00m54.6
3h 00m69.1
4h 00m75.3
5h 00m78.0
6h 00m82.7
read10s · research 3m 25s · docs_read docs/unlocks/speed.md5m 30s · research 5m 40s · docs_read docs/unlocks/plant.md5m 50s · docs_read docs/unlocks/expand_1.md9m 55s · docs_read docs/unlocks/carrots.md10m 05s · docs_read docs/unlocks/senses.md10m 15s · research 17m 15s · research 17m 25s · docs_read docs/unlocks/trees.md17m 35s · docs_read docs/unlocks/watering.md20m 35s · research 22m 15s · docs_read docs/unlocks/pumpkins.md22m 25s · docs_read docs/unlocks/fertilizer.md22m 35s · docs_list 22m 45s · docs_read objects/carrot22m 55s · docs_read objects/pumpkin23m 05s · docs_read objects/dead_pumpkin23m 15s · docs_read docs/unlocks/expand_2.md25m 39s · research 25m 59s · research 32m 53s · research 33m 13s · docs_read unlocks/sunflowers33m 33s · docs_read docs/unlocks/sunflowers.md33m 43s · docs_read objects/sunflower33m 53s · docs_read docs/scripting/lists.md40m 53s · docs_read docs/unlocks/polyculture.md41m 03s · research 49m 13s · docs_read unlocks/mazes49m 23s · research 49m 33s · docs_read docs/unlocks/mazes.md55m 27s · docs_read unlocks/megafarm55m 37s · research 55m 47s · docs_read docs/unlocks/megafarm.md1h 03m · research 1h 07m · docs_read docs/unlocks/cactus.md1h 07m · research 1h 07m · docs_read objects/cactus1h 10m · docs_read unlocks/dinosaurs1h 10m · research 1h 10m · docs_read docs/unlocks/dinosaurs.md1h 11m · docs_read objects/apple1h 11m · research 1h 14m · docs_read docs/unlocks/hats.md1h 14m · docs_read docs/home.md1h 14m · docs_read functions/change_hat1h 15m · research 1h 26m · research 1h 39m · research 1h 42m · research 1h 50m · research 2h 00m · research 2h 06m · research 2h 18m · research 2h 24m · research 2h 27m · research 2h 30m · research 2h 53m · research 2h 56m · research 2h 56m · research 3h 10m · research 3h 12m · research 3h 12m · docs_read docs/unlocks/auto_unlock.md3h 13m · research 3h 29m · research 4h 00m · research 4h 24m · docs_read docs/unlocks/debug2.md4h 24m · docs_read docs/unlocks/mazes.mdread: 68 entries, first at 10s
runningrunning: 38 entries, first at 1m 00s
errorserrors: 2 entries, first at 1h 14m

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 Gemini 4 Argon's 3 valid seeds and the 15 models on seed 2

How it played

MeasureThis runModel meanSeed 2 meanWhat it counts
Resources opened11 of 1111 of 119.6 of 11scored resources produced at least once
Study686049docs and research reads
Action overhead15%14%11%game time spent looking, reading and typing (10 s per call)
Tool calls314310228every action the agent took
Program writes383635accepted saves of a program
Program stints373742times a program was started and left running
Median stint4m 00s3m 30s5m 28show long a program usually ran before the next change
Cost per point$0.052$0.044$0.058API-equivalent estimate ÷ score

Farm idle 4% of samples; longest stint 1h 32m; 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
Wood575.3M produced · 8.76 pts
Wood575.3M produced · 8.76 pts
Carrot562.3M produced · 8.75 pts
Carrot562.3M produced · 8.75 pts
Weird substance491.1M produced · 8.69 pts
Weird substance491.1M produced · 8.69 pts
Hay422.6M produced · 8.63 pts
Hay422.6M produced · 8.63 pts
Pumpkin415.3M produced · 8.62 pts
Pumpkin415.3M produced · 8.62 pts
Cactus415.3M produced · 8.62 pts
Cactus415.3M produced · 8.62 pts
Bone70.4M produced · 7.85 pts
Bone70.4M produced · 7.85 pts
Gold51.7M produced · 7.71 pts
Gold51.7M produced · 7.71 pts
Water357.4K produced · 5.55 pts
Water357.4K produced · 5.55 pts
Power220.1K produced · 5.34 pts
Power220.1K produced · 5.34 pts
Fertilizer14.8K produced · 4.17 pts
Fertilizer14.8K produced · 4.17 pts
upgrades119 levels across 32 upgrades

Upgrade timeline

loopsloops: 1 entry, first at 1m 15s
speedspeed: 5 entries, first at 2m 05s
expandexpand: 9 entries, first at 4m 30s
plantplant: 1 entry, first at 5m 30s
operatorsoperators: 1 entry, first at 8m 40s
sensessenses: 1 entry, first at 8m 40s
carrotscarrots: 10 entries, first at 9m 55s
variablesvariables: 1 entry, first at 17m 15s
functionsfunctions: 2 entries, first at 17m 15s
treestrees: 10 entries, first at 17m 15s
wateringwatering: 9 entries, first at 17m 15s
pumpkinspumpkins: 10 entries, first at 22m 15s
fertilizerfertilizer: 4 entries, first at 22m 15s
grassgrass: 9 entries, first at 25m 39s
listslists: 1 entry, first at 32m 53s
debugdebug: 1 entry, first at 32m 53s
importimport: 1 entry, first at 32m 53s
sunflowerssunflowers: 1 entry, first at 33m 13s
polyculturepolyculture: 5 entries, first at 40m 53s
mazesmazes: 6 entries, first at 49m 13s
megafarmmegafarm: 5 entries, first at 55m 27s
cactuscactus: 6 entries, first at 1h 07m
dinosaursdinosaurs: 6 entries, first at 1h 10m
hatshats: 6 entries, first at 1h 10m
dictionariesdictionaries: 1 entry, first at 1h 11m
utilitiesutilities: 1 entry, first at 1h 11m
timingtiming: 1 entry, first at 1h 11m
costscosts: 1 entry, first at 3h 12m
auto_unlockauto_unlock: 1 entry, first at 3h 12m
debug_2debug_2: 1 entry, first at 3h 12m
simulationsimulation: 1 entry, first at 4h 23m
leaderboardleaderboard: 1 entry, first at 4h 23m
Every purchase, with what the agent was told
Game timeCallUnlockedResult the agent saw
1m 05s{"upgrades":["loops"]}loops 1Bought loops, now level 1. Paid hay 5. Its tutorial is docs page docs/scripting/while.md.
1m 55s{"upgrades":["speed"]}speed 1Bought speed, now level 1. Paid hay 20. Its tutorial is docs page docs/unlocks/speed.md.
4m 20s{"upgrades":["expand","plant"]}expand 1Bought expand, now level 1. Paid hay 30. Its tutorial is docs page docs/unlocks/expand_1.md.
5m 20s{"upgrades":["plant"]}plant 1Bought plant, now level 1. Paid hay 50. Its tutorial is docs page docs/unlocks/plant.md.
8m 30s{"upgrades":["speed","expand","operators","senses","carrots"]}speed 2, expand 2, operators 1, senses 1Bought speed, now level 2. Paid wood 20. Its tutorial is docs page docs/unlocks/speed.md.
9m 45s{"upgrades":["carrots"]}carrots 1Bought carrots, now level 1. Paid wood 50. Its tutorial is docs page docs/unlocks/carrots.md.
17m 05s{"upgrades":["variables","functions","speed","trees","watering","expand"]}variables 1, functions 1, functions 1, speed 3, trees 1, watering 1, expand 3Bought variables, now level 1. Paid carrot 35. Its tutorial is docs page docs/scripting/variables.md.
17m 45s{"upgrades":["trees"]}trees 2Bought trees, now level 2. Paid hay 300. Its tutorial is docs page docs/unlocks/trees.md.
20m 25s{"upgrades":["carrots","watering","expand"]}carrots 2, watering 2, expand 4Bought carrots, now level 2. Paid wood 250. Its tutorial is docs page docs/unlocks/carrots.md.
22m 05s{"upgrades":["grass","pumpkins","watering","fertilizer"]}pumpkins 1, watering 3, fertilizer 1Could not buy grass: Not enough resources.
24m 55s{"upgrades":["grass"]}—Could not buy grass: Not enough resources.
25m 29s{"upgrades":["grass"]}grass 2Bought grass, now level 2. Paid hay 300.
25m 49s{"upgrades":["grass","carrots","fertilizer"]}grass 3, carrots 3, fertilizer 2Bought grass, now level 3. Paid wood 500.
26m 09s{"upgrades":["grass"]}grass 4Bought grass, now level 4. Paid wood 2500.
27m 23s{"upgrades":["trees"]}trees 3Bought trees, now level 3. Paid hay 1200. Its tutorial is docs page docs/unlocks/trees.md.
32m 43s{"upgrades":["speed","lists","carrots","watering","debug","import"]}speed 4, lists 1, carrots 4, watering 4, debug 1, import 1Bought speed, now level 4. Paid carrot 500. Its tutorial is docs page docs/unlocks/speed.md.
33m 03s{"upgrades":["sunflowers"]}sunflowers 1Bought sunflowers, now level 1. Paid carrot 500. Its tutorial is docs page docs/unlocks/sunflowers.md.
40m 43s{"upgrades":["trees","fertilizer","polyculture","expand"]}trees 4, fertilizer 3, polyculture 1, expand 5Bought trees, now level 4. Paid hay 4800. Its tutorial is docs page docs/unlocks/trees.md.
44m 13s{"upgrades":["trees","grass"]}trees 5, grass 5Bought trees, now level 5. Paid hay 19200. Its tutorial is docs page docs/unlocks/trees.md.
49m 03s{"upgrades":["speed","mazes","carrots","pumpkins"]}speed 5, mazes 1, carrots 5, pumpkins 2Bought speed, now level 5. Paid carrot 1000. Its tutorial is docs page docs/unlocks/speed.md.
49m 43s{"upgrades":["watering"]}watering 5Bought watering, now level 5. Paid wood 12800. Its tutorial is docs page docs/unlocks/watering.md.
53m 03s{"upgrades":["megafarm"]}—Could not buy megafarm: Not enough resources.
54m 53s{"upgrades":["megafarm"]}—Could not buy megafarm: Not enough resources.
55m 17s{"upgrades":["megafarm"]}megafarm 1Bought megafarm, now level 1. Paid gold 2000. Its tutorial is docs page docs/unlocks/megafarm.md.
1h 02m{"upgrades":["trees","megafarm","watering"]}trees 6, megafarm 2, watering 6Bought trees, now level 6. Paid hay 76800. Its tutorial is docs page docs/unlocks/trees.md.
1h 06m{"upgrades":["expand","cactus"]}expand 6, cactus 1Bought expand, now level 6. Paid pumpkin 8000. Its tutorial is docs page docs/unlocks/expand_1.md.
1h 10m{"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 11m{"upgrades":["fertilizer","grass","dictionaries","utilities","timing"]}fertilizer 4, grass 6, dictionaries 1, utilities 1, timing 1Bought fertilizer, now level 4. Paid wood 54000. Its tutorial is docs page docs/unlocks/fertilizer.md.
1h 11m{"upgrades":["dinosaurs"]}dinosaurs 2, hats 1Bought dinosaurs, now level 2. Paid cactus 12000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
1h 15m{"upgrades":["polyculture"]}polyculture 2Bought polyculture, now level 2. Paid bone 10000. Its tutorial is docs page docs/unlocks/polyculture.md.
1h 22m{"upgrades":["megafarm"]}megafarm 3Bought megafarm, now level 3. Paid gold 32000. Its tutorial is docs page docs/unlocks/megafarm.md.
1h 26m{"upgrades":["polyculture"]}polyculture 3Bought polyculture, now level 3. Paid bone 50000. Its tutorial is docs page docs/unlocks/polyculture.md.
1h 38m{"upgrades":["polyculture"]}polyculture 4Bought polyculture, now level 4. Paid bone 250000. Its tutorial is docs page docs/unlocks/polyculture.md.
1h 42m{"upgrades":["trees","grass","carrots","watering","pumpkins"]}trees 7, grass 7, carrots 6, watering 7, pumpkins 3Bought trees, now level 7. Paid hay 307000. Its tutorial is docs page docs/unlocks/trees.md.
1h 49m{"upgrades":["dinosaurs"]}dinosaurs 3, hats 1Bought dinosaurs, now level 3. Paid cactus 72000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
1h 50m{"upgrades":["mazes"]}mazes 3Bought mazes, now level 3. Paid cactus 72000. Its tutorial is docs page docs/unlocks/mazes.md.
1h 59m{"upgrades":["megafarm"]}megafarm 4Bought megafarm, now level 4. Paid gold 128000. Its tutorial is docs page docs/unlocks/megafarm.md.
2h 05m{"upgrades":["trees","cactus","dinosaurs"]}trees 8, cactus 2, dinosaurs 4, hats 1Bought trees, now level 8. Paid hay 1230000. Its tutorial is docs page docs/unlocks/trees.md.
2h 11m{"upgrades":["pumpkins","mazes"]}mazes 4Could not buy pumpkins: Not enough resources.
2h 14m{"upgrades":["carrots"]}carrots 7Bought carrots, now level 7. Paid wood 781000. Its tutorial is docs page docs/unlocks/carrots.md.
2h 18m{"upgrades":["expand"]}expand 7Bought expand, now level 7. Paid pumpkin 64000. Its tutorial is docs page docs/unlocks/expand_1.md.
2h 24m{"upgrades":["grass","carrots","watering","watering","pumpkins","pumpkins","pumpkins","pumpkins","pumpkins","pumpkins"]}grass 8, carrots 8, watering 8, watering 9, pumpkins 4, pumpkins 5, pumpkins 6, pumpkins 7, pumpkins 8Bought grass, now level 8. Paid wood 1560000.
2h 27m{"upgrades":["cactus","cactus","cactus"]}cactus 3, cactus 4Bought cactus, now level 3. Paid pumpkin 120000. Its tutorial is docs page docs/unlocks/cactus.md.
2h 30m{"upgrades":["cactus","dinosaurs"]}cactus 5, dinosaurs 5, hats 1Bought cactus, now level 5. Paid pumpkin 4320000. Its tutorial is docs page docs/unlocks/cactus.md.
2h 37m{"upgrades":["mazes"]}mazes 5Bought mazes, now level 5. Paid cactus 2590000. Its tutorial is docs page docs/unlocks/mazes.md.
2h 40m{"upgrades":["polyculture"]}—Could not buy polyculture: Not enough resources.
2h 42m{"upgrades":["polyculture"]}polyculture 5Bought polyculture, now level 5. Paid bone 1250000. Its tutorial is docs page docs/unlocks/polyculture.md.
2h 53m{"upgrades":["megafarm"]}—Could not buy megafarm: Not enough resources.
2h 55m{"upgrades":["megafarm","expand"]}megafarm 5, expand 8Bought megafarm, now level 5. Paid gold 512000. Its tutorial is docs page docs/unlocks/megafarm.md.
2h 56m{"upgrades":["expand","grass","trees"]}expand 9, grass 9, trees 9Bought expand, now level 9. Paid pumpkin 4100000. Its tutorial is docs page docs/unlocks/expand_1.md.
3h 06m{"upgrades":["cactus"]}cactus 6Bought cactus, now level 6. Paid pumpkin 25900000. Its tutorial is docs page docs/unlocks/cactus.md.
3h 10m{"upgrades":["dinosaurs","mazes","trees","grass","carrots","pumpkins"]}dinosaurs 6, hats 1, mazes 6, trees 10, grass 10, carrots 9, pumpkins 9Bought dinosaurs, now level 6. Paid cactus 15600000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
3h 11m{"upgrades":["carrots","pumpkins","costs","auto_unlock","debug_2"]}costs 1, auto_unlock 1, debug_2 1Could not buy carrots: Not enough resources.
3h 13m{"upgrades":["carrots","pumpkins"]}carrots 10, pumpkins 10Bought carrots, now level 10. Paid wood 97700000. Its tutorial is docs page docs/unlocks/carrots.md.
3h 29m{"upgrades":["the_farmers_remains"]}—Could not buy the_farmers_remains: Not enough resources.
4h 00m{"upgrades":["the_farmers_remains"]}—Could not buy the_farmers_remains: Not enough resources.
4h 23m{"upgrades":["simulation","leaderboard"]}simulation 1, leaderboard 1Bought simulation, now level 1. Paid gold 5000. Its tutorial is docs page docs/unlocks/simulation.md.

Programs 39 writes, code as the agent wrote it

main.py38 writes · 36 ran · first at 30s
  1. r130sSaved, never run2 lines
    while True:
    	harvest()
    Write result the agent saw
    Saved main (2 lines).
    Game time: 40s elapsed, 5h 59m 20s of budget remaining.
  2. r240sRan10 lines · +10 −2 · ran 5s
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    harvest()
    Changes from the previous revision
    - while True:
    - 	harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    + harvest()
    
    Write result the agent saw
    Saved main (10 lines).
    Game time: 50s elapsed, 5h 59m 10s of budget remaining.
    run_program at 50s for 20s (agent saw)
    Ran main for 5s of game time; it finished.
    Inventory change: hay +10.
    Game time: 1m 5s elapsed, 5h 58m 55s of budget remaining.
    Output:
    (none)
  3. r31m 15sRan2 lines · +2 −10 · ran 3m 05s
    while True:
    	harvest()
    Changes from the previous revision
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    - harvest()
    + while True:
    + 	harvest()
    
    Write result the agent saw
    Saved main (2 lines).
    Game time: 1m 25s elapsed, 5h 58m 35s of budget remaining.
    run_program at 1m 25s for 20s (agent saw)
    Ran main for 20s of game time; it is still running.
    Inventory change: hay +40.
    Game time: 1m 55s elapsed, 5h 58m 5s of budget remaining.
    Output:
    (none)
    run_program at 3m 45s for 25s (agent saw)
    Ran main for 25s of game time; it is still running.
    Inventory change: no change.
    Game time: 4m 20s elapsed, 5h 55m 40s of budget remaining.
    Output:
    (none)
  4. —3m 35sRejected
    while True:
    	if can_harvest():
    		harvest()
    Write result the agent saw
    Stop the program before editing it.
  5. r44m 40sRan4 lines · +3 −1 · ran 1m 10s
    while True:
    	if can_harvest():
    		harvest()
    	move(North)
    Changes from the previous revision
      while True:
    - 	harvest()
    + 	if can_harvest():
    + 		harvest()
    + 	move(North)
    
    Write result the agent saw
    Saved main (4 lines).
    Game time: 4m 50s elapsed, 5h 55m 10s of budget remaining.
    run_program at 4m 50s for 20s (agent saw)
    Ran main for 20s of game time; it is still running.
    Inventory change: hay +30.
    Game time: 5m 20s elapsed, 5h 54m 40s of budget remaining.
    Output:
    (none)
  6. r56m 10sRan12 lines · +8 −0 · ran 2m 20s
    while True:
    	if can_harvest():
    		harvest()
    	plant(Entities.Bush)
    	move(North)
    	if can_harvest():
    		harvest()
    	plant(Entities.Bush)
    	move(North)
    	if can_harvest():
    		harvest()
    	move(North)
    Changes from the previous revision
      	if can_harvest():
      		harvest()
    + 	plant(Entities.Bush)
      	move(North)
    + 	if can_harvest():
    + 		harvest()
    + 	plant(Entities.Bush)
    + 	move(North)
    + 	if can_harvest():
    + 		harvest()
    + 	move(North)
    
    Write result the agent saw
    Saved main (12 lines).
    Game time: 6m 20s elapsed, 5h 53m 40s of budget remaining.
    run_program at 6m 20s for 100s (agent saw)
    Ran main for 1m 40s of game time; it is still running.
    Inventory change: hay +153, wood +73.
    Game time: 8m 10s elapsed, 5h 51m 50s of budget remaining.
    Output:
    (none)
  7. r68m 50sRan13 lines · +1 −0 · ran 1m 25s
    while True:
    	if can_harvest():
    		harvest()
    	plant(Entities.Bush)
    	move(North)
    	if can_harvest():
    		harvest()
    	plant(Entities.Bush)
    	move(North)
    	if can_harvest():
    		harvest()
    	move(North)
    	move(East)
    Changes from the previous revision
      		harvest()
      	move(North)
    + 	move(East)
    
    Write result the agent saw
    Saved main (13 lines).
    Game time: 9m elapsed, 5h 51m of budget remaining.
    run_program at 9m 00s for 35s (agent saw)
    Ran main for 35s of game time; it is still running.
    Inventory change: hay +33, wood +48.
    Game time: 9m 45s elapsed, 5h 50m 15s of budget remaining.
    Output:
    (none)
  8. r710m 35sRan18 lines · +14 −9 · ran 7m 10s
    while True:
    	if can_harvest():
    		harvest()
    	if get_pos_x() == 0:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    	else:
    		if get_pos_x() == 1:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(Entities.Bush)
    		else:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    	move(North)
    	if get_pos_y() == 0:
    		move(East)
    Changes from the previous revision
      	if can_harvest():
      		harvest()
    - 	plant(Entities.Bush)
    - 	move(North)
    - 	if can_harvest():
    - 		harvest()
    - 	plant(Entities.Bush)
    - 	move(North)
    - 	if can_harvest():
    - 		harvest()
    + 	if get_pos_x() == 0:
    + 		if get_ground_type() != Grounds.Grassland:
    + 			till()
    + 	else:
    + 		if get_pos_x() == 1:
    + 			if get_ground_type() != Grounds.Grassland:
    + 				till()
    + 			plant(Entities.Bush)
    + 		else:
    + 			if get_ground_type() != Grounds.Soil:
    + 				till()
    + 			plant(Entities.Carrot)
      	move(North)
    - 	move(East)
    + 	if get_pos_y() == 0:
    + 		move(East)
    
    Write result the agent saw
    Saved main (18 lines).
    Game time: 10m 45s elapsed, 5h 49m 15s of budget remaining.
    run_program at 10m 45s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +36, hay +49, wood +64.
    Game time: 11m 55s elapsed, 5h 48m 5s of budget remaining.
    Output:
    (none)
  9. r818m 05sRan22 lines · +7 −3 · ran 5m 10s
    while True:
    	if can_harvest():
    		harvest()
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    	x = get_pos_x()
    	y = get_pos_y()
    	if (x + y) % 2 == 0:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		plant(Entities.Tree)
    	else:
    		if x < 2:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    		else:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    	move(North)
    	if get_pos_y() == 0:
    		move(East)
    Changes from the previous revision
      	if can_harvest():
      		harvest()
    - 	if get_pos_x() == 0:
    + 	if get_water() < 0.75 and num_items(Items.Water) > 0:
    + 		use_item(Items.Water)
    + 	x = get_pos_x()
    + 	y = get_pos_y()
    + 	if (x + y) % 2 == 0:
      		if get_ground_type() != Grounds.Grassland:
      			till()
    + 		plant(Entities.Tree)
      	else:
    - 		if get_pos_x() == 1:
    + 		if x < 2:
      			if get_ground_type() != Grounds.Grassland:
      				till()
    - 			plant(Entities.Bush)
      		else:
      			if get_ground_type() != Grounds.Soil:
    
    Write result the agent saw
    Saved main (22 lines).
    Game time: 18m 15s elapsed, 5h 41m 45s of budget remaining.
    run_program at 18m 15s for 120s (agent saw)
    Ran main for 2m of game time; it is still running.
    Inventory change: carrot +155, hay +62, water -7, wood +2377.
    Game time: 20m 25s elapsed, 5h 39m 35s of budget remaining.
    Output:
    (none)
  10. r923m 35sRan22 lines · +1 −1 · ran 10m 19s
    while True:
    	if can_harvest():
    		harvest()
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    	x = get_pos_x()
    	y = get_pos_y()
    	if (x + y) % 2 == 0:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		plant(Entities.Tree)
    	else:
    		if num_items(Items.Hay) < 2000:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    		else:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    	move(North)
    	if get_pos_y() == 0:
    		move(East)
    Changes from the previous revision
      		plant(Entities.Tree)
      	else:
    - 		if x < 2:
    + 		if num_items(Items.Hay) < 2000:
      			if get_ground_type() != Grounds.Grassland:
      				till()
    
    Write result the agent saw
    Saved main (22 lines).
    Game time: 23m 45s elapsed, 5h 36m 15s of budget remaining.
    run_program at 23m 45s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +40, fertilizer +6, hay +106, water -8, wood +970.
    Game time: 24m 55s elapsed, 5h 35m 5s of budget remaining.
    Output:
    (none)
  11. r1034m 13sRan86 lines · +80 −16 · ran 6m 50s
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def farm_sunflowers():
    	n = get_world_size()
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    def farm_mixed():
    	n = get_world_size()
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			do_water()
    			if (x + y) % 2 == 0:
    				if get_ground_type() != Grounds.Grassland:
    					till()
    				plant(Entities.Tree)
    			else:
    				if num_items(Items.Hay) < 5000:
    					if get_ground_type() != Grounds.Grassland:
    						till()
    				else:
    					if get_ground_type() != Grounds.Soil:
    						till()
    					plant(Entities.Carrot)
    			move(North)
    		move(East)
    
    while True:
    	if num_items(Items.Carrot) > 100 and num_items(Items.Power) < 200:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 500 and num_items(Items.Pumpkin) < 15000:
    			farm_pumpkins()
    		else:
    			farm_mixed()
    Changes from the previous revision
    - while True:
    - 	if can_harvest():
    - 		harvest()
    + def do_water():
      	if get_water() < 0.75 and num_items(Items.Water) > 0:
      		use_item(Items.Water)
    - 	x = get_pos_x()
    - 	y = get_pos_y()
    - 	if (x + y) % 2 == 0:
    - 		if get_ground_type() != Grounds.Grassland:
    - 			till()
    - 		plant(Entities.Tree)
    - 	else:
    - 		if num_items(Items.Hay) < 2000:
    - 			if get_ground_type() != Grounds.Grassland:
    + 
    + def farm_sunflowers():
    + 	n = get_world_size()
    + 	for x in range(n):
    + 		for y in range(n):
    + 			if can_harvest():
    + 				harvest()
    + 			if get_ground_type() != Grounds.Soil:
      				till()
    - 		else:
    + 			do_water()
    + 			plant(Entities.Sunflower)
    + 			move(North)
    + 		move(East)
    + 	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    + 		for x in range(n):
    + 			for y in range(n):
    + 				if get_entity_type() == Entities.Sunflower and measure() == p:
    + 					while not can_harvest():
    + 						do_water()
    + 					harvest()
    + 				move(North)
    + 			move(East)
    + 
    + def farm_pumpkins():
    + 	n = get_world_size()
    + 	for x in range(n):
    + 		for y in range(n):
    + 			if can_harvest():
    + 				harvest()
      			if get_ground_type() != Grounds.Soil:
      				till()
    - 			plant(Entities.Carrot)
    - 	move(North)
    - 	if get_pos_y() == 0:
    + 			do_water()
    + 			plant(Entities.Pumpkin)
    + 			move(North)
      		move(East)
    + 	while True:
    + 		all_ready = True
    + 		for x in range(n):
    + 			for y in range(n):
    + 				if get_entity_type() != Entities.Pumpkin:
    + 					plant(Entities.Pumpkin)
    + 					do_water()
    + 					all_ready = False
    + 				else:
    + 					if not can_harvest():
    + 						do_water()
    + 						all_ready = False
    + 				move(North)
    + 			move(East)
    + 		if all_ready:
    + 			harvest()
    + 			return
    + 
    + def farm_mixed():
    + 	n = get_world_size()
    + 	for x in range(n):
    + 		for y in range(n):
    + 			if can_harvest():
    + 				harvest()
    + 			do_water()
    + 			if (x + y) % 2 == 0:
    + 				if get_ground_type() != Grounds.Grassland:
    + 					till()
    + 				plant(Entities.Tree)
    + 			else:
    + 				if num_items(Items.Hay) < 5000:
    + 					if get_ground_type() != Grounds.Grassland:
    + 						till()
    + 				else:
    + 					if get_ground_type() != Grounds.Soil:
    + 						till()
    + 					plant(Entities.Carrot)
    + 			move(North)
    + 		move(East)
    + 
    + while True:
    + 	if num_items(Items.Carrot) > 100 and num_items(Items.Power) < 200:
    + 		farm_sunflowers()
    + 	else:
    + 		if num_items(Items.Carrot) > 500 and num_items(Items.Pumpkin) < 15000:
    + 			farm_pumpkins()
    + 		else:
    + 			farm_mixed()
    
    Write result the agent saw
    Saved main (86 lines).
    Game time: 34m 23s elapsed, 5h 25m 37s of budget remaining.
    run_program at 34m 23s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +161, fertilizer +12, hay +8, power +196.71, pumpkin +216, water -16, wood +500.
    Game time: 35m 33s elapsed, 5h 24m 27s of budget remaining.
    Output:
    (none)
  12. r1141m 23sRan129 lines · +68 −25 · ran 5m 00s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def farm_poly():
    	if num_items(Items.Hay) < 20000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 40000:
    			base = Entities.Tree
    		else:
    			base = Entities.Carrot
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(0, 0)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 50 and num_items(Items.Weird_Substance) < 2000:
    			use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 1500 and num_items(Items.Pumpkin) < 20000:
    			farm_pumpkins()
    		else:
    			farm_poly()
    Changes from the previous revision
    + def move_to(tx, ty):
    + 	n = get_world_size()
    + 	cx = get_pos_x()
    + 	cy = get_pos_y()
    + 	dx = (tx - cx) % n
    + 	if dx <= n // 2:
    + 		for i in range(dx):
    + 			move(East)
    + 	else:
    + 		for i in range(n - dx):
    + 			move(West)
    + 	dy = (ty - cy) % n
    + 	if dy <= n // 2:
    + 		for i in range(dy):
    + 			move(North)
    + 	else:
    + 		for i in range(n - dy):
    + 			move(South)
    + 
      def do_water():
      	if get_water() < 0.75 and num_items(Items.Water) > 0:
      		use_item(Items.Water)
      
    + def ensure_plant(p):
    + 	if p == Entities.Grass:
    + 		if get_ground_type() != Grounds.Grassland:
    + 			till()
    + 		else:
    + 			if get_entity_type() != Entities.Grass:
    + 				till()
    + 				till()
    + 	else:
    + 		if p == Entities.Carrot:
    + 			if get_ground_type() != Grounds.Soil:
    + 				till()
    + 			plant(Entities.Carrot)
    + 		else:
    + 			if get_ground_type() != Grounds.Grassland:
    + 				till()
    + 			plant(p)
    + 
    + def farm_poly():
    + 	if num_items(Items.Hay) < 20000:
    + 		base = Entities.Grass
    + 	else:
    + 		if num_items(Items.Wood) < 40000:
    + 			base = Entities.Tree
    + 		else:
    + 			base = Entities.Carrot
    + 	move_to(0, 0)
    + 	if can_harvest():
    + 		harvest()
    + 	ensure_plant(base)
    + 	comp = get_companion()
    + 	if comp != None:
    + 		c_type, (cx, cy) = comp
    + 		move_to(cx, cy)
    + 		if can_harvest():
    + 			harvest()
    + 		ensure_plant(c_type)
    + 		move_to(0, 0)
    + 	while not can_harvest():
    + 		do_water()
    + 		if num_items(Items.Fertilizer) > 50 and num_items(Items.Weird_Substance) < 2000:
    + 			use_item(Items.Fertilizer)
    + 	harvest()
    + 
      def farm_sunflowers():
      	n = get_world_size()
    + 	move_to(0, 0)
      	for x in range(n):
      		for y in range(n):
      def farm_pumpkins():
      	n = get_world_size()
    + 	move_to(0, 0)
      	for x in range(n):
      		for y in range(n):
      			return
      
    - def farm_mixed():
    - 	n = get_world_size()
    - 	for x in range(n):
    - 		for y in range(n):
    - 			if can_harvest():
    - 				harvest()
    - 			do_water()
    - 			if (x + y) % 2 == 0:
    - 				if get_ground_type() != Grounds.Grassland:
    - 					till()
    - 				plant(Entities.Tree)
    - 			else:
    - 				if num_items(Items.Hay) < 5000:
    - 					if get_ground_type() != Grounds.Grassland:
    - 						till()
    - 				else:
    - 					if get_ground_type() != Grounds.Soil:
    - 						till()
    - 					plant(Entities.Carrot)
    - 			move(North)
    - 		move(East)
    - 
      while True:
    - 	if num_items(Items.Carrot) > 100 and num_items(Items.Power) < 200:
    + 	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 500 and num_items(Items.Pumpkin) < 15000:
    + 		if num_items(Items.Carrot) > 1500 and num_items(Items.Pumpkin) < 20000:
      			farm_pumpkins()
      		else:
    - 			farm_mixed()
    + 			farm_poly()
    
    Write result the agent saw
    Saved main (129 lines).
    Game time: 41m 33s elapsed, 5h 18m 27s of budget remaining.
    run_program at 41m 33s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot -56, fertilizer +23, hay +1768, power +508.61, water +18, weird_substance +40, wood -8.
    Game time: 42m 43s elapsed, 5h 17m 17s of budget remaining.
    Output:
    (none)
  13. r1246m 43sRan145 lines · +20 −4 · ran 3m 10s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors():
    	n = get_world_size()
    	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def farm_poly():
    	if num_items(Items.Hay) < 25000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 50000:
    			base = Entities.Tree
    			clear_neighbors()
    		else:
    			base = Entities.Carrot
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(0, 0)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 3000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    			farm_pumpkins()
    		else:
    			farm_poly()
    Changes from the previous revision
      			plant(p)
      
    + def clear_neighbors():
    + 	n = get_world_size()
    + 	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    + 		nx, ny = pos
    + 		move_to(nx, ny)
    + 		if get_entity_type() == Entities.Tree:
    + 			if can_harvest():
    + 				harvest()
    + 			else:
    + 				till()
    + 				till()
    + 
      def farm_poly():
    - 	if num_items(Items.Hay) < 20000:
    + 	if num_items(Items.Hay) < 25000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 40000:
    + 		if num_items(Items.Wood) < 50000:
      			base = Entities.Tree
    + 			clear_neighbors()
      		else:
      			base = Entities.Carrot
      	while not can_harvest():
      		do_water()
    - 		if num_items(Items.Fertilizer) > 50 and num_items(Items.Weird_Substance) < 2000:
    + 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 3000:
      			use_item(Items.Fertilizer)
    + 		else:
    + 			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    + 				use_item(Items.Fertilizer)
      	harvest()
      
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 1500 and num_items(Items.Pumpkin) < 20000:
    + 		if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
      			farm_pumpkins()
      		else:
    
    Write result the agent saw
    Saved main (145 lines).
    Game time: 46m 53s elapsed, 5h 13m 7s of budget remaining.
    run_program at 46m 53s for 120s (agent saw)
    Ran main for 2m of game time; it is still running.
    Inventory change: carrot +1015, fertilizer -28, hay +8448, power -80.89, pumpkin +387, water -59, weird_substance +26800, wood +29872.
    Game time: 49m 3s elapsed, 5h 10m 57s of budget remaining.
    Output:
    (none)
  14. r1350m 13sRan161 lines · +22 −6 · ran 1m 10s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors():
    	n = get_world_size()
    	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def farm_gold():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	while num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 10:
    		plant(Entities.Bush)
    		sub = 1 * 2**(num_unlocked(Unlocks.Mazes) - 1)
    		use_item(Items.Weird_Substance, sub)
    		if get_entity_type() == Entities.Treasure:
    			harvest()
    
    def farm_poly():
    	if num_items(Items.Hay) < 25000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 50000:
    			base = Entities.Tree
    			clear_neighbors()
    		else:
    			base = Entities.Carrot
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(0, 0)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 2000:
    		farm_gold()
    	else:
    		if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    			farm_sunflowers()
    		else:
    			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    				farm_pumpkins()
    			else:
    				farm_poly()
    Changes from the previous revision
      				till()
      
    + def farm_gold():
    + 	move_to(0, 0)
    + 	if can_harvest():
    + 		harvest()
    + 	if get_ground_type() != Grounds.Grassland:
    + 		till()
    + 	while num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 10:
    + 		plant(Entities.Bush)
    + 		sub = 1 * 2**(num_unlocked(Unlocks.Mazes) - 1)
    + 		use_item(Items.Weird_Substance, sub)
    + 		if get_entity_type() == Entities.Treasure:
    + 			harvest()
    + 
      def farm_poly():
      	if num_items(Items.Hay) < 25000:
      	while not can_harvest():
      		do_water()
    - 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 3000:
    + 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
      			use_item(Items.Fertilizer)
      		else:
      
      while True:
    - 	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    - 		farm_sunflowers()
    + 	if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 2000:
    + 		farm_gold()
      	else:
    - 		if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    - 			farm_pumpkins()
    + 		if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    + 			farm_sunflowers()
      		else:
    - 			farm_poly()
    + 			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    + 				farm_pumpkins()
    + 			else:
    + 				farm_poly()
    
    Write result the agent saw
    Saved main (161 lines).
    Game time: 50m 23s elapsed, 5h 9m 37s of budget remaining.
    run_program at 50m 23s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +24, gold +595, power -60.59, water +96, weird_substance -195, wood +400.
    Game time: 51m 33s elapsed, 5h 8m 27s of budget remaining.
    Output:
    (none)
  15. r1451m 43sRan165 lines · +6 −2 · ran 1m 30s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors():
    	n = get_world_size()
    	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def farm_gold():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	while num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 500:
    		plant(Entities.Bush)
    		sub = 1 * 2**(num_unlocked(Unlocks.Mazes) - 1)
    		use_item(Items.Weird_Substance, sub)
    		for i in range(299):
    			if num_items(Items.Gold) >= 2000 or num_items(Items.Weird_Substance) <= sub:
    				break
    			use_item(Items.Weird_Substance, sub)
    		if get_entity_type() == Entities.Treasure:
    			harvest()
    
    def farm_poly():
    	if num_items(Items.Hay) < 25000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 55000:
    			base = Entities.Tree
    			clear_neighbors()
    		else:
    			base = Entities.Carrot
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(0, 0)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 2000:
    		farm_gold()
    	else:
    		if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    			farm_sunflowers()
    		else:
    			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    				farm_pumpkins()
    			else:
    				farm_poly()
    Changes from the previous revision
      	if get_ground_type() != Grounds.Grassland:
      		till()
    - 	while num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 10:
    + 	while num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 500:
      		plant(Entities.Bush)
      		sub = 1 * 2**(num_unlocked(Unlocks.Mazes) - 1)
      		use_item(Items.Weird_Substance, sub)
    + 		for i in range(299):
    + 			if num_items(Items.Gold) >= 2000 or num_items(Items.Weird_Substance) <= sub:
    + 				break
    + 			use_item(Items.Weird_Substance, sub)
      		if get_entity_type() == Entities.Treasure:
      			harvest()
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 50000:
    + 		if num_items(Items.Wood) < 55000:
      			base = Entities.Tree
      			clear_neighbors()
    
    Write result the agent saw
    Saved main (165 lines).
    Game time: 51m 53s elapsed, 5h 8m 7s of budget remaining.
    run_program at 51m 53s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +24, gold +135, power -60.57, water +96, weird_substance -135.
    Game time: 53m 3s elapsed, 5h 6m 57s of budget remaining.
    Output:
    (none)
  16. r1553m 33sRan169 lines · +19 −15 · ran 2m 14s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors():
    	n = get_world_size()
    	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def farm_poly():
    	if num_items(Items.Hay) < 25000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 55000:
    			base = Entities.Tree
    			clear_neighbors()
    		else:
    			base = Entities.Carrot
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(0, 0)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 1000:
    			solve_maze()
    		else:
    			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    				farm_pumpkins()
    			else:
    				farm_poly()
    Changes from the previous revision
      				till()
      
    - def farm_gold():
    + def solve_maze():
      	move_to(0, 0)
      	if can_harvest():
      	if get_ground_type() != Grounds.Grassland:
      		till()
    - 	while num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 500:
    - 		plant(Entities.Bush)
    - 		sub = 1 * 2**(num_unlocked(Unlocks.Mazes) - 1)
    - 		use_item(Items.Weird_Substance, sub)
    - 		for i in range(299):
    - 			if num_items(Items.Gold) >= 2000 or num_items(Items.Weird_Substance) <= sub:
    - 				break
    - 			use_item(Items.Weird_Substance, sub)
    - 		if get_entity_type() == Entities.Treasure:
    - 			harvest()
    + 	plant(Entities.Bush)
    + 	n = get_world_size()
    + 	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    + 	use_item(Items.Weird_Substance, sub)
    + 	dirs = [North, East, South, West]
    + 	idx = 0
    + 	while get_entity_type() != Entities.Treasure:
    + 		if get_entity_type() != Entities.Hedge:
    + 			return
    + 		idx = (idx + 1) % 4
    + 		while not can_move(dirs[idx]):
    + 			idx = (idx - 1) % 4
    + 		move(dirs[idx])
    + 	harvest()
      
      def farm_poly():
      
      while True:
    - 	if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 2000:
    - 		farm_gold()
    + 	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    + 		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    - 			farm_sunflowers()
    + 		if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 1000:
    + 			solve_maze()
      		else:
      			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    
    Write result the agent saw
    Saved main (169 lines).
    Game time: 53m 43s elapsed, 5h 6m 17s of budget remaining.
    run_program at 53m 43s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +208, fertilizer +24, gold +577, hay +144, power +388.41, water +30, weird_substance -80, wood +112.
    Game time: 54m 53s elapsed, 5h 5m 7s of budget remaining.
    Output:
    (none)
  17. r1656m 07sRan169 lines · +3 −3 · ran 1m 10s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors():
    	n = get_world_size()
    	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def farm_poly():
    	if num_items(Items.Hay) < 80000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 120000:
    			base = Entities.Tree
    			clear_neighbors()
    		else:
    			base = Entities.Carrot
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(0, 0)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Gold) < 8000 and num_items(Items.Weird_Substance) > 1000:
    			solve_maze()
    		else:
    			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    				farm_pumpkins()
    			else:
    				farm_poly()
    Changes from the previous revision
      
      def farm_poly():
    - 	if num_items(Items.Hay) < 25000:
    + 	if num_items(Items.Hay) < 80000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 55000:
    + 		if num_items(Items.Wood) < 120000:
      			base = Entities.Tree
      			clear_neighbors()
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Gold) < 2000 and num_items(Items.Weird_Substance) > 1000:
    + 		if num_items(Items.Gold) < 8000 and num_items(Items.Weird_Substance) > 1000:
      			solve_maze()
      		else:
    
    Write result the agent saw
    Saved main (169 lines).
    Game time: 56m 17s elapsed, 5h 3m 43s of budget remaining.
    run_program at 56m 17s for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +24, gold +1664, hay +112, power -60.57, water +96, weird_substance -216.
    Game time: 57m 27s elapsed, 5h 2m 33s of budget remaining.
    Output:
    (none)
  18. r1757m 37sRan208 lines · +48 −9 · ran 5m 40s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 150:
    		if num_items(Items.Hay) < 80000:
    			base = Entities.Grass
    		else:
    			if num_items(Items.Wood) < 160000:
    				base = Entities.Tree
    				clear_neighbors(bx, by)
    			else:
    				base = Entities.Carrot
    		move_to(bx, by)
    		if can_harvest():
    			harvest()
    		ensure_plant(base)
    		comp = get_companion()
    		if comp != None:
    			c_type, (cx, cy) = comp
    			move_to(cx, cy)
    			if can_harvest():
    				harvest()
    			ensure_plant(c_type)
    			move_to(bx, by)
    		while not can_harvest():
    			do_water()
    			if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    				use_item(Items.Fertilizer)
    			else:
    				if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    					use_item(Items.Fertilizer)
    		harvest()
    
    def farm_poly(bx, by):
    	if num_items(Items.Hay) < 80000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 160000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def farm_sunflowers():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Sunflower)
    			move(North)
    		move(East)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() == Entities.Sunflower and measure() == p:
    					while not can_harvest():
    						do_water()
    					harvest()
    				move(North)
    			move(East)
    
    def farm_pumpkins():
    	n = get_world_size()
    	move_to(0, 0)
    	for x in range(n):
    		for y in range(n):
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Soil:
    				till()
    			do_water()
    			plant(Entities.Pumpkin)
    			move(North)
    		move(East)
    	while True:
    		all_ready = True
    		for x in range(n):
    			for y in range(n):
    				if get_entity_type() != Entities.Pumpkin:
    					plant(Entities.Pumpkin)
    					do_water()
    					all_ready = False
    				else:
    					if not can_harvest():
    						do_water()
    						all_ready = False
    				move(North)
    			move(East)
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Gold) < 8000 and num_items(Items.Weird_Substance) > 1000:
    			while num_drones() > 1:
    				do_a_flip()
    			solve_maze()
    		else:
    			if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 30000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_pumpkins()
    			else:
    				if num_drones() < max_drones():
    					spawn_drone(poly_worker, 4, 4)
    				farm_poly(0, 0)
    Changes from the previous revision
      			plant(p)
      
    - def clear_neighbors():
    + def clear_neighbors(bx, by):
      	n = get_world_size()
    - 	for pos in [(0, 1), (1, 0), (0, n - 1), (n - 1, 0)]:
    + 	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
      		nx, ny = pos
      		move_to(nx, ny)
      	harvest()
      
    - def farm_poly():
    + def poly_worker(bx, by):
    + 	while num_items(Items.Power) > 150:
    + 		if num_items(Items.Hay) < 80000:
    + 			base = Entities.Grass
    + 		else:
    + 			if num_items(Items.Wood) < 160000:
    + 				base = Entities.Tree
    + 				clear_neighbors(bx, by)
    + 			else:
    + 				base = Entities.Carrot
    + 		move_to(bx, by)
    + 		if can_harvest():
    + 			harvest()
    + 		ensure_plant(base)
    + 		comp = get_companion()
    + 		if comp != None:
    + 			c_type, (cx, cy) = comp
    + 			move_to(cx, cy)
    + 			if can_harvest():
    + 				harvest()
    + 			ensure_plant(c_type)
    + 			move_to(bx, by)
    + 		while not can_harvest():
    + 			do_water()
    + 			if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    + 				use_item(Items.Fertilizer)
    + 			else:
    + 				if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    + 					use_item(Items.Fertilizer)
    + 		harvest()
    + 
    + def farm_poly(bx, by):
      	if num_items(Items.Hay) < 80000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 120000:
    + 		if num_items(Items.Wood) < 160000:
      			base = Entities.Tree
    - 			clear_neighbors()
    + 			clear_neighbors(bx, by)
      		else:
      			base = Entities.Carrot
    - 	move_to(0, 0)
    + 	move_to(bx, by)
      	if can_harvest():
      		harvest()
      			harvest()
      		ensure_plant(c_type)
    - 		move_to(0, 0)
    + 		move_to(bx, by)
      	while not can_harvest():
      		do_water()
      while True:
      	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    + 		while num_drones() > 1:
    + 			do_a_flip()
      		farm_sunflowers()
      	else:
      		if num_items(Items.Gold) < 8000 and num_items(Items.Weird_Substance) > 1000:
    + 			while num_drones() > 1:
    + 				do_a_flip()
      			solve_maze()
      		else:
    - 			if num_items(Items.Carrot) > 2500 and num_items(Items.Pumpkin) < 25000:
    + 			if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 30000:
    + 				while num_drones() > 1:
    + 					do_a_flip()
      				farm_pumpkins()
      			else:
    - 				farm_poly()
    + 				if num_drones() < max_drones():
    + 					spawn_drone(poly_worker, 4, 4)
    + 				farm_poly(0, 0)
    
    Write result the agent saw
    Saved main (208 lines).
    Game time: 57m 47s elapsed, 5h 2m 13s of budget remaining.
    run_program at 57m 47s for 300s (agent saw)
    Ran main for 5m of game time; it is still running.
    Inventory change: carrot +2288, fertilizer +90, gold +5184, hay +49872, power -309.64, water +470, weird_substance +10992, wood +17864.
    Game time: 1h 2m 57s elapsed, 4h 57m 3s of budget remaining.
    Output:
    (none)
  19. r181h 03mRan224 lines · +97 −81 · ran 4m 00s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 80000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 250000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    			while num_drones() > 1:
    				do_a_flip()
    			farm_pumpkins()
    		else:
    			if num_drones() == 1:
    				spawn_drone(poly_worker, 0, 4)
    				spawn_drone(poly_worker, 4, 0)
    				spawn_drone(poly_worker, 4, 4)
    			poly_step(0, 0)
    Changes from the previous revision
      	harvest()
      
    - def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 150:
    - 		if num_items(Items.Hay) < 80000:
    - 			base = Entities.Grass
    - 		else:
    - 			if num_items(Items.Wood) < 160000:
    - 				base = Entities.Tree
    - 				clear_neighbors(bx, by)
    - 			else:
    - 				base = Entities.Carrot
    - 		move_to(bx, by)
    - 		if can_harvest():
    - 			harvest()
    - 		ensure_plant(base)
    - 		comp = get_companion()
    - 		if comp != None:
    - 			c_type, (cx, cy) = comp
    - 			move_to(cx, cy)
    - 			if can_harvest():
    - 				harvest()
    - 			ensure_plant(c_type)
    - 			move_to(bx, by)
    - 		while not can_harvest():
    - 			do_water()
    - 			if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    - 				use_item(Items.Fertilizer)
    - 			else:
    - 				if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    - 					use_item(Items.Fertilizer)
    - 		harvest()
    - 
    - def farm_poly(bx, by):
    + def poly_step(bx, by):
      	if num_items(Items.Hay) < 80000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 160000:
    + 		if num_items(Items.Wood) < 250000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      	harvest()
      
    + def poly_worker(bx, by):
    + 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000):
    + 		poly_step(bx, by)
    + 
    + def sf_plant_col(x):
    + 	move_to(x, 0)
    + 	n = get_world_size()
    + 	for y in range(n):
    + 		if can_harvest():
    + 			harvest()
    + 		if get_ground_type() != Grounds.Soil:
    + 			till()
    + 		do_water()
    + 		plant(Entities.Sunflower)
    + 		move(North)
    + 
    + def sf_harvest_col(x, p):
    + 	move_to(x, 0)
    + 	n = get_world_size()
    + 	for y in range(n):
    + 		if get_entity_type() == Entities.Sunflower and measure() == p:
    + 			while not can_harvest():
    + 				do_water()
    + 			harvest()
    + 		move(North)
    + 
      def farm_sunflowers():
      	n = get_world_size()
    - 	move_to(0, 0)
    + 	drones = []
      	for x in range(n):
    - 		for y in range(n):
    - 			if can_harvest():
    - 				harvest()
    - 			if get_ground_type() != Grounds.Soil:
    - 				till()
    - 			do_water()
    - 			plant(Entities.Sunflower)
    - 			move(North)
    - 		move(East)
    + 		d = spawn_drone(sf_plant_col, x)
    + 		if d != None:
    + 			drones.append(d)
    + 		else:
    + 			sf_plant_col(x)
    + 	for d in drones:
    + 		wait_for(d)
      	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    + 		drones = []
      		for x in range(n):
    - 			for y in range(n):
    - 				if get_entity_type() == Entities.Sunflower and measure() == p:
    - 					while not can_harvest():
    - 						do_water()
    - 					harvest()
    - 				move(North)
    - 			move(East)
    + 			d = spawn_drone(sf_harvest_col, x, p)
    + 			if d != None:
    + 				drones.append(d)
    + 			else:
    + 				sf_harvest_col(x, p)
    + 		for d in drones:
    + 			wait_for(d)
      
    + def pk_plant_col(x):
    + 	move_to(x, 0)
    + 	n = get_world_size()
    + 	for y in range(n):
    + 		if can_harvest():
    + 			harvest()
    + 		if get_ground_type() != Grounds.Soil:
    + 			till()
    + 		do_water()
    + 		plant(Entities.Pumpkin)
    + 		move(North)
    + 
    + def pk_check_col(x):
    + 	move_to(x, 0)
    + 	n = get_world_size()
    + 	ready = True
    + 	for y in range(n):
    + 		if get_entity_type() != Entities.Pumpkin:
    + 			plant(Entities.Pumpkin)
    + 			do_water()
    + 			ready = False
    + 		else:
    + 			if not can_harvest():
    + 				do_water()
    + 				ready = False
    + 		move(North)
    + 	return ready
    + 
      def farm_pumpkins():
      	n = get_world_size()
    - 	move_to(0, 0)
    + 	drones = []
      	for x in range(n):
    - 		for y in range(n):
    - 			if can_harvest():
    - 				harvest()
    - 			if get_ground_type() != Grounds.Soil:
    - 				till()
    - 			do_water()
    - 			plant(Entities.Pumpkin)
    - 			move(North)
    - 		move(East)
    + 		d = spawn_drone(pk_plant_col, x)
    + 		if d != None:
    + 			drones.append(d)
    + 		else:
    + 			pk_plant_col(x)
    + 	for d in drones:
    + 		wait_for(d)
      	while True:
      		all_ready = True
    + 		drones = []
      		for x in range(n):
    - 			for y in range(n):
    - 				if get_entity_type() != Entities.Pumpkin:
    - 					plant(Entities.Pumpkin)
    - 					do_water()
    + 			d = spawn_drone(pk_check_col, x)
    + 			if d != None:
    + 				drones.append(d)
    + 			else:
    + 				if not pk_check_col(x):
      					all_ready = False
    - 				else:
    - 					if not can_harvest():
    - 						do_water()
    - 						all_ready = False
    - 				move(North)
    - 			move(East)
    + 		for d in drones:
    + 			if not wait_for(d):
    + 				all_ready = False
      		if all_ready:
      			harvest()
      
      while True:
    - 	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 300:
    + 	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
      		while num_drones() > 1:
      			do_a_flip()
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Gold) < 8000 and num_items(Items.Weird_Substance) > 1000:
    + 		if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
      			while num_drones() > 1:
      				do_a_flip()
    - 			solve_maze()
    + 			farm_pumpkins()
      		else:
    - 			if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 30000:
    - 				while num_drones() > 1:
    - 					do_a_flip()
    - 				farm_pumpkins()
    - 			else:
    - 				if num_drones() < max_drones():
    - 					spawn_drone(poly_worker, 4, 4)
    - 				farm_poly(0, 0)
    + 			if num_drones() == 1:
    + 				spawn_drone(poly_worker, 0, 4)
    + 				spawn_drone(poly_worker, 4, 0)
    + 				spawn_drone(poly_worker, 4, 4)
    + 			poly_step(0, 0)
    
    Write result the agent saw
    Saved main (224 lines).
    Game time: 1h 3m 47s elapsed, 4h 56m 13s of budget remaining.
    run_program at 1h 03m for 180s (agent saw)
    Ran main for 3m of game time; it is still running.
    Inventory change: carrot -1298, fertilizer +72, hay +31104, power +328.74, pumpkin +12288, water +99, wood +19136.
    Game time: 1h 6m 57s elapsed, 4h 53m 3s of budget remaining.
    Output:
    Warning: Cannot plant Entities.Carrot on Grounds.Grassland.
    In: poly_step <- ensure_plant
    plant(Entities.Carrot)
         ^^               
    --------------------------------------------------------------------
  20. r191h 07mRan292 lines · +76 −8 · ran 3m 50s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 80000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 250000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000) and not (num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(North):
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(East):
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000:
    			while num_drones() > 1:
    				do_a_flip()
    			farm_cactus()
    		else:
    			if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_pumpkins()
    			else:
    				if num_drones() == 1:
    					spawn_drone(poly_worker, 0, 6)
    					spawn_drone(poly_worker, 6, 0)
    					spawn_drone(poly_worker, 6, 6)
    				poly_step(0, 0)
    Changes from the previous revision
      
      def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000):
    + 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000) and not (num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000):
      		poly_step(bx, by)
      
      	ready = True
      	for y in range(n):
    + 		if get_ground_type() != Grounds.Soil:
    + 			till()
      		if get_entity_type() != Entities.Pumpkin:
      			plant(Entities.Pumpkin)
      			return
      
    + def cc_plant_sort_col(x):
    + 	move_to(x, 0)
    + 	n = get_world_size()
    + 	for y in range(n):
    + 		if can_harvest():
    + 			harvest()
    + 		if get_ground_type() != Grounds.Soil:
    + 			till()
    + 		plant(Entities.Cactus)
    + 		move(North)
    + 	for pass_num in range(n):
    + 		move_to(x, 0)
    + 		swapped = False
    + 		for y in range(n - 1 - pass_num):
    + 			while not can_harvest():
    + 				do_water()
    + 			if measure() > measure(North):
    + 				swap(North)
    + 				swapped = True
    + 			move(North)
    + 		if not swapped:
    + 			break
    + 
    + def cc_sort_row(y):
    + 	n = get_world_size()
    + 	for pass_num in range(n):
    + 		move_to(0, y)
    + 		swapped = False
    + 		for x in range(n - 1 - pass_num):
    + 			while not can_harvest():
    + 				do_water()
    + 			if measure() > measure(East):
    + 				swap(East)
    + 				swapped = True
    + 			move(East)
    + 		if not swapped:
    + 			break
    + 
    + def farm_cactus():
    + 	n = get_world_size()
    + 	drones = []
    + 	for x in range(n):
    + 		d = spawn_drone(cc_plant_sort_col, x)
    + 		if d != None:
    + 			drones.append(d)
    + 		else:
    + 			cc_plant_sort_col(x)
    + 	for d in drones:
    + 		wait_for(d)
    + 	drones = []
    + 	for y in range(n):
    + 		d = spawn_drone(cc_sort_row, y)
    + 		if d != None:
    + 			drones.append(d)
    + 		else:
    + 			cc_sort_row(y)
    + 	for d in drones:
    + 		wait_for(d)
    + 	move_to(0, 0)
    + 	harvest()
    + 
      while True:
      	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    + 		if num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000:
      			while num_drones() > 1:
      				do_a_flip()
    - 			farm_pumpkins()
    + 			farm_cactus()
      		else:
    - 			if num_drones() == 1:
    - 				spawn_drone(poly_worker, 0, 4)
    - 				spawn_drone(poly_worker, 4, 0)
    - 				spawn_drone(poly_worker, 4, 4)
    - 			poly_step(0, 0)
    + 			if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    + 				while num_drones() > 1:
    + 					do_a_flip()
    + 				farm_pumpkins()
    + 			else:
    + 				if num_drones() == 1:
    + 					spawn_drone(poly_worker, 0, 6)
    + 					spawn_drone(poly_worker, 6, 0)
    + 					spawn_drone(poly_worker, 6, 6)
    + 				poly_step(0, 0)
    
    Write result the agent saw
    Saved main (292 lines).
    Game time: 1h 8m 7s elapsed, 4h 51m 53s of budget remaining.
    run_program at 1h 08m for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot -144, fertilizer +24, hay +2304, power +901.76, pumpkin -288, water +54.
    Game time: 1h 9m 17s elapsed, 4h 50m 43s of budget remaining.
    Output:
    (none)
  21. r201h 12mRan358 lines · +76 −10 · ran 1m 34s · 1 runtime error
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Green_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 80000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 250000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000) and not (num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000) and not (num_items(Items.Cactus) > 1000 and num_items(Items.Bone) < 50000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(North):
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(East):
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Cactus) > 1000 and num_items(Items.Bone) < 50000:
    			while num_drones() > 1:
    				do_a_flip()
    			farm_dinosaurs()
    		else:
    			if num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_cactus()
    			else:
    				if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    					while num_drones() > 1:
    						do_a_flip()
    					farm_pumpkins()
    				else:
    					if num_drones() == 1:
    						spawn_drone(poly_worker, 0, 6)
    						spawn_drone(poly_worker, 6, 0)
    						spawn_drone(poly_worker, 6, 6)
    					poly_step(0, 0)
    Changes from the previous revision
      	harvest()
      
    + def clear_col(x):
    + 	move_to(x, 0)
    + 	n = get_world_size()
    + 	for y in range(n):
    + 		if can_harvest():
    + 			harvest()
    + 		if get_ground_type() != Grounds.Grassland:
    + 			till()
    + 		else:
    + 			if get_entity_type() != Entities.Grass:
    + 				till()
    + 				till()
    + 		move(North)
    + 
    + def farm_dinosaurs():
    + 	n = get_world_size()
    + 	drones = []
    + 	for x in range(n):
    + 		d = spawn_drone(clear_col, x)
    + 		if d != None:
    + 			drones.append(d)
    + 		else:
    + 			clear_col(x)
    + 	for d in drones:
    + 		wait_for(d)
    + 	move_to(0, 0)
    + 	change_hat(Hats.Dinosaur_Hat)
    + 	alive = True
    + 	while alive:
    + 		for y in range(n - 1):
    + 			if not move(North):
    + 				alive = False
    + 				break
    + 		if not alive:
    + 			break
    + 		for x in range(n - 1):
    + 			if not move(East):
    + 				alive = False
    + 				break
    + 			if x % 2 == 0:
    + 				for i in range(n - 2):
    + 					if not move(South):
    + 						alive = False
    + 						break
    + 			else:
    + 				for i in range(n - 2):
    + 					if not move(North):
    + 						alive = False
    + 						break
    + 			if not alive:
    + 				break
    + 		if not alive:
    + 			break
    + 		if not move(South):
    + 			break
    + 		for x in range(n - 1):
    + 			if not move(West):
    + 				alive = False
    + 				break
    + 	change_hat(Hats.Green_Hat)
    + 
      def poly_step(bx, by):
      	if num_items(Items.Hay) < 80000:
      
      def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000) and not (num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000):
    + 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000) and not (num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000) and not (num_items(Items.Cactus) > 1000 and num_items(Items.Bone) < 50000):
      		poly_step(bx, by)
      
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000:
    + 		if num_items(Items.Cactus) > 1000 and num_items(Items.Bone) < 50000:
      			while num_drones() > 1:
      				do_a_flip()
    - 			farm_cactus()
    + 			farm_dinosaurs()
      		else:
    - 			if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    + 			if num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000:
      				while num_drones() > 1:
      					do_a_flip()
    - 				farm_pumpkins()
    + 				farm_cactus()
      			else:
    - 				if num_drones() == 1:
    - 					spawn_drone(poly_worker, 0, 6)
    - 					spawn_drone(poly_worker, 6, 0)
    - 					spawn_drone(poly_worker, 6, 6)
    - 				poly_step(0, 0)
    + 				if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    + 					while num_drones() > 1:
    + 						do_a_flip()
    + 					farm_pumpkins()
    + 				else:
    + 					if num_drones() == 1:
    + 						spawn_drone(poly_worker, 0, 6)
    + 						spawn_drone(poly_worker, 6, 0)
    + 						spawn_drone(poly_worker, 6, 6)
    + 					poly_step(0, 0)
    
    Write result the agent saw
    Saved main (358 lines).
    Game time: 1h 12m 17s elapsed, 4h 47m 43s of budget remaining.
    run_program at 1h 12m for 120s (agent saw)
    Ran main for 1m 34s of game time; it stopped with an error: Hats.Green_Hat must be unlocked before this can be used.
    Inventory change: cactus -572, carrot +16, fertilizer +76, power -104.30, pumpkin +898, water +301.
    Game time: 1h 14m 1s elapsed, 4h 45m 59s of budget remaining.
    Output:
    Error: Hats.Green_Hat must be unlocked before this can be used.
    In: farm_dinosaurs
    change_hat(Hats.Green_Hat)
              ^^              
    --------------------------------------------------------------------
    Runtime error at 1h 14m (telemetry; not shown to the agent)
    Hats.Green_Hat must be unlocked before this can be used.
  22. r211h 15mRan363 lines · +20 −15 · ran 1m 10s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	dirs = [North, East, South, West]
    	idx = 0
    	while get_entity_type() != Entities.Treasure:
    		if get_entity_type() != Entities.Hedge:
    			return
    		idx = (idx + 1) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - 1) % 4
    		move(dirs[idx])
    	harvest()
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 350000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 400000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000) and not (num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000) and not (num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(North):
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(East):
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000:
    			while num_drones() > 1:
    				do_a_flip()
    			solve_maze()
    		else:
    			if num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_dinosaurs()
    			else:
    				if num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000:
    					while num_drones() > 1:
    						do_a_flip()
    					farm_cactus()
    				else:
    					if num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000:
    						while num_drones() > 1:
    							do_a_flip()
    						farm_pumpkins()
    					else:
    						if num_drones() == 1:
    							spawn_drone(poly_worker, 0, 6)
    							spawn_drone(poly_worker, 6, 0)
    							spawn_drone(poly_worker, 6, 6)
    						poly_step(0, 0)
    Changes from the previous revision
      				alive = False
      				break
    - 	change_hat(Hats.Green_Hat)
    + 	change_hat(Hats.Straw_Hat)
      
      def poly_step(bx, by):
    - 	if num_items(Items.Hay) < 80000:
    + 	if num_items(Items.Hay) < 350000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 250000:
    + 		if num_items(Items.Wood) < 400000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      
      def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000) and not (num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000) and not (num_items(Items.Cactus) > 1000 and num_items(Items.Bone) < 50000):
    + 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000) and not (num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000) and not (num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000):
      		poly_step(bx, by)
      
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Cactus) > 1000 and num_items(Items.Bone) < 50000:
    + 		if num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000:
      			while num_drones() > 1:
      				do_a_flip()
    - 			farm_dinosaurs()
    + 			solve_maze()
      		else:
    - 			if num_items(Items.Pumpkin) > 1000 and num_items(Items.Cactus) < 15000:
    + 			if num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000:
      				while num_drones() > 1:
      					do_a_flip()
    - 				farm_cactus()
    + 				farm_dinosaurs()
      			else:
    - 				if num_items(Items.Carrot) > 3000 and num_items(Items.Pumpkin) < 35000:
    + 				if num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000:
      					while num_drones() > 1:
      						do_a_flip()
    - 					farm_pumpkins()
    + 					farm_cactus()
      				else:
    - 					if num_drones() == 1:
    - 						spawn_drone(poly_worker, 0, 6)
    - 						spawn_drone(poly_worker, 6, 0)
    - 						spawn_drone(poly_worker, 6, 6)
    - 					poly_step(0, 0)
    + 					if num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000:
    + 						while num_drones() > 1:
    + 							do_a_flip()
    + 						farm_pumpkins()
    + 					else:
    + 						if num_drones() == 1:
    + 							spawn_drone(poly_worker, 0, 6)
    + 							spawn_drone(poly_worker, 6, 0)
    + 							spawn_drone(poly_worker, 6, 6)
    + 						poly_step(0, 0)
    
    Write result the agent saw
    Saved main (363 lines).
    Game time: 1h 16m 1s elapsed, 4h 43m 59s of budget remaining.
    run_program at 1h 16m for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +48, gold +3456, power -60.66, water +192, weird_substance -312.
    Game time: 1h 17m 11s elapsed, 4h 42m 49s of budget remaining.
    Output:
    (none)
  23. r221h 17mRan374 lines · +21 −10 · ran 9m 00s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 2, 1)
    	d3 = spawn_drone(maze_follower, 2, -1)
    	maze_follower(0, 1)
    	if d1 != None:
    		wait_for(d1)
    	if d2 != None:
    		wait_for(d2)
    	if d3 != None:
    		wait_for(d3)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 350000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 400000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000) and not (num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000) and not (num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(North):
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(East):
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000:
    			while num_drones() > 1:
    				do_a_flip()
    			solve_maze()
    		else:
    			if num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_dinosaurs()
    			else:
    				if num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000:
    					while num_drones() > 1:
    						do_a_flip()
    					farm_cactus()
    				else:
    					if num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000:
    						while num_drones() > 1:
    							do_a_flip()
    						farm_pumpkins()
    					else:
    						if num_drones() == 1:
    							spawn_drone(poly_worker, 0, 6)
    							spawn_drone(poly_worker, 6, 0)
    							spawn_drone(poly_worker, 6, 6)
    						poly_step(0, 0)
    Changes from the previous revision
      				till()
      
    + def maze_follower(start_idx, turn_step):
    + 	dirs = [North, East, South, West]
    + 	idx = start_idx
    + 	while get_entity_type() == Entities.Hedge:
    + 		idx = (idx + turn_step) % 4
    + 		while not can_move(dirs[idx]):
    + 			idx = (idx - turn_step) % 4
    + 		move(dirs[idx])
    + 	if get_entity_type() == Entities.Treasure:
    + 		harvest()
    + 
      def solve_maze():
      	move_to(0, 0)
      	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
      	use_item(Items.Weird_Substance, sub)
    - 	dirs = [North, East, South, West]
    - 	idx = 0
    - 	while get_entity_type() != Entities.Treasure:
    - 		if get_entity_type() != Entities.Hedge:
    - 			return
    - 		idx = (idx + 1) % 4
    - 		while not can_move(dirs[idx]):
    - 			idx = (idx - 1) % 4
    - 		move(dirs[idx])
    - 	harvest()
    + 	d1 = spawn_drone(maze_follower, 0, -1)
    + 	d2 = spawn_drone(maze_follower, 2, 1)
    + 	d3 = spawn_drone(maze_follower, 2, -1)
    + 	maze_follower(0, 1)
    + 	if d1 != None:
    + 		wait_for(d1)
    + 	if d2 != None:
    + 		wait_for(d2)
    + 	if d3 != None:
    + 		wait_for(d3)
      
      def clear_col(x):
    
    Write result the agent saw
    Saved main (374 lines).
    Game time: 1h 17m 31s elapsed, 4h 42m 29s of budget remaining.
    run_program at 1h 17m for 300s (agent saw)
    Ran main for 5m of game time; it is still running.
    Inventory change: cactus -64, carrot -144, fertilizer +240, gold +28224, hay +8224, power +146.29, water +814, weird_substance -2352.
    Game time: 1h 22m 41s elapsed, 4h 37m 19s of budget remaining.
    Output:
    (none)
  24. r231h 26mRan380 lines · +28 −22 · ran 13s · 1 runtime error
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 350000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 600000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 20000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000) and not (num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(North):
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			if measure() > measure(East):
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    			while num_drones() > 1:
    				do_a_flip()
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000:
    					while num_drones() > 1:
    						do_a_flip()
    					farm_dinosaurs()
    				else:
    					if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
    						while num_drones() > 1:
    							do_a_flip()
    						solve_maze()
    					else:
    						if num_drones() == 1:
    							n = get_world_size()
    							spawn_drone(poly_worker, 0, n // 2)
    							spawn_drone(poly_worker, n // 2, 0)
    							spawn_drone(poly_worker, n // 2, n // 2)
    							spawn_drone(poly_worker, n // 4, n // 4)
    							spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    							spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    							spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
    						poly_step(0, 0)
    Changes from the previous revision
      	use_item(Items.Weird_Substance, sub)
      	d1 = spawn_drone(maze_follower, 0, -1)
    - 	d2 = spawn_drone(maze_follower, 2, 1)
    - 	d3 = spawn_drone(maze_follower, 2, -1)
    + 	d2 = spawn_drone(maze_follower, 1, 1)
    + 	d3 = spawn_drone(maze_follower, 1, -1)
    + 	d4 = spawn_drone(maze_follower, 2, 1)
    + 	d5 = spawn_drone(maze_follower, 2, -1)
    + 	d6 = spawn_drone(maze_follower, 3, 1)
    + 	d7 = spawn_drone(maze_follower, 3, -1)
      	maze_follower(0, 1)
    - 	if d1 != None:
    - 		wait_for(d1)
    - 	if d2 != None:
    - 		wait_for(d2)
    - 	if d3 != None:
    - 		wait_for(d3)
    + 	for d in [d1, d2, d3, d4, d5, d6, d7]:
    + 		if d != None:
    + 			wait_for(d)
      
      def clear_col(x):
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 400000:
    + 		if num_items(Items.Wood) < 600000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      	while not can_harvest():
      		do_water()
    - 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 5000:
    + 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 20000:
      			use_item(Items.Fertilizer)
      		else:
      
      def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000) and not (num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000) and not (num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000):
    + 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000) and not (num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000):
      		poly_step(bx, by)
      
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Gold) < 32000 and num_items(Items.Weird_Substance) > 5000:
    + 		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
      			while num_drones() > 1:
      				do_a_flip()
    - 			solve_maze()
    + 			farm_pumpkins()
      		else:
    - 			if num_items(Items.Cactus) > 2000 and num_items(Items.Bone) < 60000:
    + 			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
      				while num_drones() > 1:
      					do_a_flip()
    - 				farm_dinosaurs()
    + 				farm_cactus()
      			else:
    - 				if num_items(Items.Pumpkin) > 2000 and num_items(Items.Cactus) < 80000:
    + 				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000:
      					while num_drones() > 1:
      						do_a_flip()
    - 					farm_cactus()
    + 					farm_dinosaurs()
      				else:
    - 					if num_items(Items.Carrot) > 5000 and num_items(Items.Pumpkin) < 90000:
    + 					if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
      						while num_drones() > 1:
      							do_a_flip()
    - 						farm_pumpkins()
    + 						solve_maze()
      					else:
      						if num_drones() == 1:
    - 							spawn_drone(poly_worker, 0, 6)
    - 							spawn_drone(poly_worker, 6, 0)
    - 							spawn_drone(poly_worker, 6, 6)
    + 							n = get_world_size()
    + 							spawn_drone(poly_worker, 0, n // 2)
    + 							spawn_drone(poly_worker, n // 2, 0)
    + 							spawn_drone(poly_worker, n // 2, n // 2)
    + 							spawn_drone(poly_worker, n // 4, n // 4)
    + 							spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    + 							spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    + 							spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
      						poly_step(0, 0)
    
    Write result the agent saw
    Saved main (380 lines).
    Game time: 1h 26m 51s elapsed, 4h 33m 9s of budget remaining.
    run_program at 1h 26m for 300s (agent saw)
    Ran main for 13s of game time; it stopped with an error: The operator > cannot be used on the operands None and 0.
    Inventory change: cactus +12, fertilizer +10, hay +2688, power -60.19, pumpkin -216, water +39.
    Game time: 1h 27m 14s elapsed, 4h 32m 46s of budget remaining.
    Output:
    Error: The operator > cannot be used on the operands None and 0.
    In: cc_sort_row
    if measure() > measure(East):
              ^^^^^^^^^^^^^^^^^^^^
    --------------------------------------------------------------------
    Runtime error at 1h 27m (telemetry; not shown to the agent)
    The operator > cannot be used on the operands None and 0.
  25. r241h 27mRan384 lines · +6 −2 · ran 11m 41s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 350000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 600000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 20000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000) and not (num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    			while num_drones() > 1:
    				do_a_flip()
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000:
    					while num_drones() > 1:
    						do_a_flip()
    					farm_dinosaurs()
    				else:
    					if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
    						while num_drones() > 1:
    							do_a_flip()
    						solve_maze()
    					else:
    						if num_drones() == 1:
    							n = get_world_size()
    							spawn_drone(poly_worker, 0, n // 2)
    							spawn_drone(poly_worker, n // 2, 0)
    							spawn_drone(poly_worker, n // 2, n // 2)
    							spawn_drone(poly_worker, n // 4, n // 4)
    							spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    							spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    							spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
    						poly_step(0, 0)
    Changes from the previous revision
      			while not can_harvest():
      				do_water()
    - 			if measure() > measure(North):
    + 			m1 = measure()
    + 			m2 = measure(North)
    + 			if m1 != None and m2 != None and m1 > m2:
      				swap(North)
      				swapped = True
      			while not can_harvest():
      				do_water()
    - 			if measure() > measure(East):
    + 			m1 = measure()
    + 			m2 = measure(East)
    + 			if m1 != None and m2 != None and m1 > m2:
      				swap(East)
      				swapped = True
    
    Write result the agent saw
    Saved main (384 lines).
    Game time: 1h 27m 34s elapsed, 4h 32m 26s of budget remaining.
    run_program at 1h 27m for 300s (agent saw)
    Ran main for 5m of game time; it is still running.
    Inventory change: bone +81796, cactus +19576, fertilizer +240, hay +1536, power -421.22, pumpkin -288, water +948.
    Game time: 1h 32m 44s elapsed, 4h 27m 16s of budget remaining.
    Output:
    (none)
  26. r251h 39mRan379 lines · +14 −19 · ran 6m 50s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 400000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 800000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 20000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_worker(bx, by):
    	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000):
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    while True:
    	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    		while num_drones() > 1:
    			do_a_flip()
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    			while num_drones() > 1:
    				do_a_flip()
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    				while num_drones() > 1:
    					do_a_flip()
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    					while num_drones() > 1:
    						do_a_flip()
    					farm_dinosaurs()
    				else:
    					if num_drones() == 1:
    						n = get_world_size()
    						spawn_drone(poly_worker, 0, n // 2)
    						spawn_drone(poly_worker, n // 2, 0)
    						spawn_drone(poly_worker, n // 2, n // 2)
    						spawn_drone(poly_worker, n // 4, n // 4)
    						spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    						spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    						spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
    					poly_step(0, 0)
    Changes from the previous revision
      
      def poly_step(bx, by):
    - 	if num_items(Items.Hay) < 350000:
    + 	if num_items(Items.Hay) < 400000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 600000:
    + 		if num_items(Items.Wood) < 800000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      
      def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000) and not (num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000):
    + 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000):
      		poly_step(bx, by)
      
      				farm_cactus()
      			else:
    - 				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 260000:
    + 				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
      					while num_drones() > 1:
      						do_a_flip()
      					farm_dinosaurs()
      				else:
    - 					if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
    - 						while num_drones() > 1:
    - 							do_a_flip()
    - 						solve_maze()
    - 					else:
    - 						if num_drones() == 1:
    - 							n = get_world_size()
    - 							spawn_drone(poly_worker, 0, n // 2)
    - 							spawn_drone(poly_worker, n // 2, 0)
    - 							spawn_drone(poly_worker, n // 2, n // 2)
    - 							spawn_drone(poly_worker, n // 4, n // 4)
    - 							spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    - 							spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    - 							spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
    - 						poly_step(0, 0)
    + 					if num_drones() == 1:
    + 						n = get_world_size()
    + 						spawn_drone(poly_worker, 0, n // 2)
    + 						spawn_drone(poly_worker, n // 2, 0)
    + 						spawn_drone(poly_worker, n // 2, n // 2)
    + 						spawn_drone(poly_worker, n // 4, n // 4)
    + 						spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    + 						spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    + 						spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
    + 					poly_step(0, 0)
    
    Write result the agent saw
    Saved main (379 lines).
    Game time: 1h 39m 35s elapsed, 4h 20m 25s of budget remaining.
    run_program at 1h 39m for 180s (agent saw)
    Ran main for 3m of game time; it is still running.
    Inventory change: carrot +6624, fertilizer +39, hay +363536, power -655.14, water +524, weird_substance +659360, wood +672976.
    Game time: 1h 42m 45s elapsed, 4h 17m 15s of budget remaining.
    Output:
    (none)
  27. r261h 46mRan375 lines · +17 −21 · ran 3m 50s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 400000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 800000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 20000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(8):
    		if num_items(Items.Power) < 250:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    					farm_dinosaurs()
    				else:
    					n = get_world_size()
    					drones = []
    					for pos in [(0, n // 2), (n // 2, 0), (n // 2, n // 2), (n // 4, n // 4), (n // 4, 3 * (n // 4)), (3 * (n // 4), n // 4), (3 * (n // 4), 3 * (n // 4))]:
    						px, py = pos
    						d = spawn_drone(poly_batch, px, py)
    						if d != None:
    							drones.append(d)
    					poly_batch(0, 0)
    					for d in drones:
    						wait_for(d)
    Changes from the previous revision
      	harvest()
      
    - def poly_worker(bx, by):
    - 	while num_items(Items.Power) > 250 and not (num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000) and not (num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000) and not (num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000):
    + def poly_batch(bx, by):
    + 	for i in range(8):
    + 		if num_items(Items.Power) < 250:
    + 			break
      		poly_step(bx, by)
      
      	harvest()
      
    + change_hat(Hats.Straw_Hat)
    + 
      while True:
    - 	if num_items(Items.Carrot) > 200 and num_items(Items.Power) < 400:
    - 		while num_drones() > 1:
    - 			do_a_flip()
    + 	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
      		farm_sunflowers()
      	else:
      		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    - 			while num_drones() > 1:
    - 				do_a_flip()
      			farm_pumpkins()
      		else:
      			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    - 				while num_drones() > 1:
    - 					do_a_flip()
      				farm_cactus()
      			else:
      				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    - 					while num_drones() > 1:
    - 						do_a_flip()
      					farm_dinosaurs()
      				else:
    - 					if num_drones() == 1:
    - 						n = get_world_size()
    - 						spawn_drone(poly_worker, 0, n // 2)
    - 						spawn_drone(poly_worker, n // 2, 0)
    - 						spawn_drone(poly_worker, n // 2, n // 2)
    - 						spawn_drone(poly_worker, n // 4, n // 4)
    - 						spawn_drone(poly_worker, n // 4, 3 * (n // 4))
    - 						spawn_drone(poly_worker, 3 * (n // 4), n // 4)
    - 						spawn_drone(poly_worker, 3 * (n // 4), 3 * (n // 4))
    - 					poly_step(0, 0)
    + 					n = get_world_size()
    + 					drones = []
    + 					for pos in [(0, n // 2), (n // 2, 0), (n // 2, n // 2), (n // 4, n // 4), (n // 4, 3 * (n // 4)), (3 * (n // 4), n // 4), (3 * (n // 4), 3 * (n // 4))]:
    + 						px, py = pos
    + 						d = spawn_drone(poly_batch, px, py)
    + 						if d != None:
    + 							drones.append(d)
    + 					poly_batch(0, 0)
    + 					for d in drones:
    + 						wait_for(d)
    
    Write result the agent saw
    Saved main (375 lines).
    Game time: 1h 46m 45s elapsed, 4h 13m 15s of budget remaining.
    run_program at 1h 46m for 180s (agent saw)
    Ran main for 3m of game time; it is still running.
    Inventory change: bone +32, cactus +82944, carrot +2588, fertilizer +144, hay +17088, power +1280.62, pumpkin +12384, water +400, wood +34176.
    Game time: 1h 49m 55s elapsed, 4h 10m 5s of budget remaining.
    Output:
    (none)
  28. r271h 50mRan378 lines · +22 −19 · ran 9m 26s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 1300000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 2500000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(8):
    		if num_items(Items.Power) < 250:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
    			solve_maze()
    		else:
    			if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    				farm_pumpkins()
    			else:
    				if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    					farm_cactus()
    				else:
    					if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    						farm_dinosaurs()
    					else:
    						n = get_world_size()
    						drones = []
    						for pos in [(0, n // 2), (n // 2, 0), (n // 2, n // 2), (n // 4, n // 4), (n // 4, 3 * (n // 4)), (3 * (n // 4), n // 4), (3 * (n // 4), 3 * (n // 4))]:
    							px, py = pos
    							d = spawn_drone(poly_batch, px, py)
    							if d != None:
    								drones.append(d)
    						poly_batch(0, 0)
    						for d in drones:
    							wait_for(d)
    Changes from the previous revision
      
      def poly_step(bx, by):
    - 	if num_items(Items.Hay) < 400000:
    + 	if num_items(Items.Hay) < 1300000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 800000:
    + 		if num_items(Items.Wood) < 2500000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      	while not can_harvest():
      		do_water()
    - 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 20000:
    + 		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
      			use_item(Items.Fertilizer)
      		else:
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    - 			farm_pumpkins()
    + 		if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
    + 			solve_maze()
      		else:
    - 			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    - 				farm_cactus()
    + 			if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    + 				farm_pumpkins()
      			else:
    - 				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    - 					farm_dinosaurs()
    + 				if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    + 					farm_cactus()
      				else:
    - 					n = get_world_size()
    - 					drones = []
    - 					for pos in [(0, n // 2), (n // 2, 0), (n // 2, n // 2), (n // 4, n // 4), (n // 4, 3 * (n // 4)), (3 * (n // 4), n // 4), (3 * (n // 4), 3 * (n // 4))]:
    - 						px, py = pos
    - 						d = spawn_drone(poly_batch, px, py)
    - 						if d != None:
    - 							drones.append(d)
    - 					poly_batch(0, 0)
    - 					for d in drones:
    - 						wait_for(d)
    + 					if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    + 						farm_dinosaurs()
    + 					else:
    + 						n = get_world_size()
    + 						drones = []
    + 						for pos in [(0, n // 2), (n // 2, 0), (n // 2, n // 2), (n // 4, n // 4), (n // 4, 3 * (n // 4)), (3 * (n // 4), n // 4), (3 * (n // 4), 3 * (n // 4))]:
    + 							px, py = pos
    + 							d = spawn_drone(poly_batch, px, py)
    + 							if d != None:
    + 								drones.append(d)
    + 						poly_batch(0, 0)
    + 						for d in drones:
    + 							wait_for(d)
    
    Write result the agent saw
    Saved main (378 lines).
    Game time: 1h 50m 55s elapsed, 4h 9m 5s of budget remaining.
    run_program at 1h 50m for 300s (agent saw)
    Ran main for 5m of game time; it is still running.
    Inventory change: cactus +1, carrot -288, fertilizer +240, gold +62208, hay +18240, power +179.61, water +1607, weird_substance -5232.
    Game time: 1h 56m 5s elapsed, 4h 3m 55s of budget remaining.
    Output:
    (none)
  29. r282h 00mRan377 lines · +18 −19 · ran 14m 20s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 1300000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 2500000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(8):
    		if num_items(Items.Power) < 250:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 450000:
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    					farm_dinosaurs()
    				else:
    					n = get_world_size()
    					s = n // 4
    					drones = []
    					for i in range(4):
    						for j in range(4):
    							if i != 0 or j != 0:
    								d = spawn_drone(poly_batch, i * s, j * s)
    								if d != None:
    									drones.append(d)
    					poly_batch(0, 0)
    					for d in drones:
    						wait_for(d)
    Changes from the previous revision
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Gold) < 128000 and num_items(Items.Weird_Substance) > 5000:
    - 			solve_maze()
    + 		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    + 			farm_pumpkins()
      		else:
    - 			if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    - 				farm_pumpkins()
    + 			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 450000:
    + 				farm_cactus()
      			else:
    - 				if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 150000:
    - 					farm_cactus()
    + 				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    + 					farm_dinosaurs()
      				else:
    - 					if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    - 						farm_dinosaurs()
    - 					else:
    - 						n = get_world_size()
    - 						drones = []
    - 						for pos in [(0, n // 2), (n // 2, 0), (n // 2, n // 2), (n // 4, n // 4), (n // 4, 3 * (n // 4)), (3 * (n // 4), n // 4), (3 * (n // 4), 3 * (n // 4))]:
    - 							px, py = pos
    - 							d = spawn_drone(poly_batch, px, py)
    - 							if d != None:
    - 								drones.append(d)
    - 						poly_batch(0, 0)
    - 						for d in drones:
    - 							wait_for(d)
    + 					n = get_world_size()
    + 					s = n // 4
    + 					drones = []
    + 					for i in range(4):
    + 						for j in range(4):
    + 							if i != 0 or j != 0:
    + 								d = spawn_drone(poly_batch, i * s, j * s)
    + 								if d != None:
    + 									drones.append(d)
    + 					poly_batch(0, 0)
    + 					for d in drones:
    + 						wait_for(d)
    
    Write result the agent saw
    Saved main (377 lines).
    Game time: 2h 41s elapsed, 3h 59m 19s of budget remaining.
    run_program at 2h 00m for 300s (agent saw)
    Ran main for 5m of game time; it is still running.
    Inventory change: cactus +414720, carrot +6688, fertilizer +222, hay +1092416, power +491.81, pumpkin +14976, water +920, weird_substance +217760, wood +441568.
    Game time: 2h 5m 51s elapsed, 3h 54m 9s of budget remaining.
    Output:
    Warning: Cannot plant Entities.Carrot on Grounds.Grassland.
    In: poly_batch <- poly_step <- ensure_plant
    plant(Entities.Carrot)
         ^^               
    --------------------------------------------------------------------
  30. r292h 15mRan379 lines · +2 −0 · ran 9m 10s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	d1 = spawn_drone(maze_follower, 0, -1)
    	d2 = spawn_drone(maze_follower, 1, 1)
    	d3 = spawn_drone(maze_follower, 1, -1)
    	d4 = spawn_drone(maze_follower, 2, 1)
    	d5 = spawn_drone(maze_follower, 2, -1)
    	d6 = spawn_drone(maze_follower, 3, 1)
    	d7 = spawn_drone(maze_follower, 3, -1)
    	maze_follower(0, 1)
    	for d in [d1, d2, d3, d4, d5, d6, d7]:
    		if d != None:
    			wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 1300000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 2500000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(8):
    		if num_items(Items.Power) < 250:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 450000:
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    					farm_dinosaurs()
    				else:
    					n = get_world_size()
    					s = n // 4
    					drones = []
    					for i in range(4):
    						for j in range(4):
    							if i != 0 or j != 0:
    								d = spawn_drone(poly_batch, i * s, j * s)
    								if d != None:
    									drones.append(d)
    					poly_batch(0, 0)
    					for d in drones:
    						wait_for(d)
    Changes from the previous revision
      			till()
      		if get_entity_type() != Entities.Pumpkin:
    + 			if can_harvest():
    + 				harvest()
      			plant(Entities.Pumpkin)
      			do_water()
    
    Write result the agent saw
    Saved main (379 lines).
    Game time: 2h 15m 21s elapsed, 3h 44m 39s of budget remaining.
    run_program at 2h 15m for 180s (agent saw)
    Ran main for 3m of game time; it is still running.
    Inventory change: cactus +373248, carrot -8124, fertilizer +144, power +447.70, pumpkin +33964, water +346.
    Game time: 2h 18m 31s elapsed, 3h 41m 29s of budget remaining.
    Output:
    (none)
  31. r302h 24mRan381 lines · +29 −27 · ran 31m 51s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	drones = []
    	for s in range(4):
    		for t in [-1, 1]:
    			if s != 0 or t != 1:
    				d = spawn_drone(maze_follower, s, t)
    				if d != None:
    					drones.append(d)
    	maze_follower(0, 1)
    	for d in drones:
    		wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 5500000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 28000000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(8):
    		if num_items(Items.Power) < 250:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 100000 and num_items(Items.Pumpkin) < 5000000:
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 20000 and num_items(Items.Cactus) < 6000000:
    				farm_cactus()
    			else:
    				if num_items(Items.Cactus) > 50000 and num_items(Items.Bone) < 1300000:
    					farm_dinosaurs()
    				else:
    					if num_items(Items.Gold) < 512000 and num_items(Items.Weird_Substance) > 50000:
    						solve_maze()
    					else:
    						n = get_world_size()
    						s = n // 4
    						drones = []
    						for i in range(4):
    							for j in range(4):
    								if i != 0 or j != 0:
    									d = spawn_drone(poly_batch, i * s, j * s)
    									if d != None:
    										drones.append(d)
    						poly_batch(0, 0)
    						for d in drones:
    							wait_for(d)
    Changes from the previous revision
      	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
      	use_item(Items.Weird_Substance, sub)
    - 	d1 = spawn_drone(maze_follower, 0, -1)
    - 	d2 = spawn_drone(maze_follower, 1, 1)
    - 	d3 = spawn_drone(maze_follower, 1, -1)
    - 	d4 = spawn_drone(maze_follower, 2, 1)
    - 	d5 = spawn_drone(maze_follower, 2, -1)
    - 	d6 = spawn_drone(maze_follower, 3, 1)
    - 	d7 = spawn_drone(maze_follower, 3, -1)
    + 	drones = []
    + 	for s in range(4):
    + 		for t in [-1, 1]:
    + 			if s != 0 or t != 1:
    + 				d = spawn_drone(maze_follower, s, t)
    + 				if d != None:
    + 					drones.append(d)
      	maze_follower(0, 1)
    - 	for d in [d1, d2, d3, d4, d5, d6, d7]:
    - 		if d != None:
    - 			wait_for(d)
    + 	for d in drones:
    + 		wait_for(d)
      
      def clear_col(x):
      
      def poly_step(bx, by):
    - 	if num_items(Items.Hay) < 1300000:
    + 	if num_items(Items.Hay) < 5500000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 2500000:
    + 		if num_items(Items.Wood) < 28000000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 8000 and num_items(Items.Pumpkin) < 90000:
    + 		if num_items(Items.Carrot) > 100000 and num_items(Items.Pumpkin) < 5000000:
      			farm_pumpkins()
      		else:
    - 			if num_items(Items.Pumpkin) > 4000 and num_items(Items.Cactus) < 450000:
    + 			if num_items(Items.Pumpkin) > 20000 and num_items(Items.Cactus) < 6000000:
      				farm_cactus()
      			else:
    - 				if num_items(Items.Cactus) > 4000 and num_items(Items.Bone) < 10000:
    + 				if num_items(Items.Cactus) > 50000 and num_items(Items.Bone) < 1300000:
      					farm_dinosaurs()
      				else:
    - 					n = get_world_size()
    - 					s = n // 4
    - 					drones = []
    - 					for i in range(4):
    - 						for j in range(4):
    - 							if i != 0 or j != 0:
    - 								d = spawn_drone(poly_batch, i * s, j * s)
    - 								if d != None:
    - 									drones.append(d)
    - 					poly_batch(0, 0)
    - 					for d in drones:
    - 						wait_for(d)
    + 					if num_items(Items.Gold) < 512000 and num_items(Items.Weird_Substance) > 50000:
    + 						solve_maze()
    + 					else:
    + 						n = get_world_size()
    + 						s = n // 4
    + 						drones = []
    + 						for i in range(4):
    + 							for j in range(4):
    + 								if i != 0 or j != 0:
    + 									d = spawn_drone(poly_batch, i * s, j * s)
    + 									if d != None:
    + 										drones.append(d)
    + 						poly_batch(0, 0)
    + 						for d in drones:
    + 							wait_for(d)
    
    Write result the agent saw
    Saved main (381 lines).
    Game time: 2h 24m 51s elapsed, 3h 35m 9s of budget remaining.
    run_program at 2h 24m for 120s (agent saw)
    Ran main for 2m of game time; it is still running.
    Inventory change: carrot -695424, fertilizer +96, power -40.74, pumpkin +3342336, water +1565.
    Game time: 2h 27m 1s elapsed, 3h 32m 59s of budget remaining.
    Output:
    (none)
  32. r312h 56mRan381 lines · +31 −31 · ran 9m 40s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	drones = []
    	for s in range(4):
    		for t in [-1, 1]:
    			if s != 0 or t != 1:
    				d = spawn_drone(maze_follower, s, t)
    				if d != None:
    					drones.append(d)
    	maze_follower(0, 1)
    	for d in drones:
    		wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 25000000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 65000000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(12):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 1000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Carrot) > 500000 and num_items(Items.Pumpkin) < 28000000:
    			farm_pumpkins()
    		else:
    			if num_items(Items.Pumpkin) > 100000 and num_items(Items.Cactus) < 35000000:
    				farm_cactus()
    			else:
    				n = get_world_size()
    				drones = []
    				for i in range(8):
    					for j in range(4):
    						if i != 0 or j != 0:
    							d = spawn_drone(poly_batch, i * 4, j * 8)
    							if d != None:
    								drones.append(d)
    				poly_batch(0, 0)
    				for d in drones:
    					wait_for(d)
    Changes from the previous revision
      
      def poly_step(bx, by):
    - 	if num_items(Items.Hay) < 5500000:
    + 	if num_items(Items.Hay) < 25000000:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 28000000:
    + 		if num_items(Items.Wood) < 65000000:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      
      def poly_batch(bx, by):
    - 	for i in range(8):
    - 		if num_items(Items.Power) < 250:
    + 	for i in range(12):
    + 		if num_items(Items.Power) < 300:
      			break
      		poly_step(bx, by)
      	n = get_world_size()
      	drones = []
    - 	for x in range(n):
    + 	for x in range(n - 1):
      		d = spawn_drone(sf_plant_col, x)
      		if d != None:
      		else:
      			sf_plant_col(x)
    + 	sf_plant_col(n - 1)
      	for d in drones:
      		wait_for(d)
      	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
      		drones = []
    - 		for x in range(n):
    + 		for x in range(n - 1):
      			d = spawn_drone(sf_harvest_col, x, p)
      			if d != None:
      			else:
      				sf_harvest_col(x, p)
    + 		sf_harvest_col(n - 1, p)
      		for d in drones:
      			wait_for(d)
      	n = get_world_size()
      	drones = []
    - 	for x in range(n):
    + 	for x in range(n - 1):
      		d = spawn_drone(pk_plant_col, x)
      		if d != None:
      		else:
      			pk_plant_col(x)
    + 	pk_plant_col(n - 1)
      	for d in drones:
      		wait_for(d)
      		all_ready = True
      		drones = []
    - 		for x in range(n):
    + 		for x in range(n - 1):
      			d = spawn_drone(pk_check_col, x)
      			if d != None:
      				if not pk_check_col(x):
      					all_ready = False
    + 		if not pk_check_col(n - 1):
    + 			all_ready = False
      		for d in drones:
      			if not wait_for(d):
      	n = get_world_size()
      	drones = []
    - 	for x in range(n):
    + 	for x in range(n - 1):
      		d = spawn_drone(cc_plant_sort_col, x)
      		if d != None:
      		else:
      			cc_plant_sort_col(x)
    + 	cc_plant_sort_col(n - 1)
      	for d in drones:
      		wait_for(d)
      	drones = []
    - 	for y in range(n):
    + 	for y in range(n - 1):
      		d = spawn_drone(cc_sort_row, y)
      		if d != None:
      		else:
      			cc_sort_row(y)
    + 	cc_sort_row(n - 1)
      	for d in drones:
      		wait_for(d)
      
      while True:
    - 	if num_items(Items.Carrot) > 1000 and num_items(Items.Power) < 500:
    + 	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 1000:
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 100000 and num_items(Items.Pumpkin) < 5000000:
    + 		if num_items(Items.Carrot) > 500000 and num_items(Items.Pumpkin) < 28000000:
      			farm_pumpkins()
      		else:
    - 			if num_items(Items.Pumpkin) > 20000 and num_items(Items.Cactus) < 6000000:
    + 			if num_items(Items.Pumpkin) > 100000 and num_items(Items.Cactus) < 35000000:
      				farm_cactus()
      			else:
    - 				if num_items(Items.Cactus) > 50000 and num_items(Items.Bone) < 1300000:
    - 					farm_dinosaurs()
    - 				else:
    - 					if num_items(Items.Gold) < 512000 and num_items(Items.Weird_Substance) > 50000:
    - 						solve_maze()
    - 					else:
    - 						n = get_world_size()
    - 						s = n // 4
    - 						drones = []
    - 						for i in range(4):
    - 							for j in range(4):
    - 								if i != 0 or j != 0:
    - 									d = spawn_drone(poly_batch, i * s, j * s)
    - 									if d != None:
    - 										drones.append(d)
    - 						poly_batch(0, 0)
    - 						for d in drones:
    - 							wait_for(d)
    + 				n = get_world_size()
    + 				drones = []
    + 				for i in range(8):
    + 					for j in range(4):
    + 						if i != 0 or j != 0:
    + 							d = spawn_drone(poly_batch, i * 4, j * 8)
    + 							if d != None:
    + 								drones.append(d)
    + 				poly_batch(0, 0)
    + 				for d in drones:
    + 					wait_for(d)
    
    Write result the agent saw
    Saved main (381 lines).
    Game time: 2h 57m 2s elapsed, 3h 2m 58s of budget remaining.
    run_program at 2h 57m for 300s (agent saw)
    Ran main for 5m of game time; it is still running.
    Inventory change: carrot -2940928, fertilizer +240, power +3253.59, pumpkin +13369344, water -3609.
    Game time: 3h 2m 12s elapsed, 2h 57m 48s of budget remaining.
    Output:
    (none)
  33. r323h 06mRan379 lines · +15 −17 · ran 6m 57s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	drones = []
    	for s in range(4):
    		for t in [-1, 1]:
    			if s != 0 or t != 1:
    				d = spawn_drone(maze_follower, s, t)
    				if d != None:
    					drones.append(d)
    	maze_follower(0, 1)
    	for d in drones:
    		wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	clear_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	if num_items(Items.Hay) < 25000000:
    		base = Entities.Grass
    	else:
    		if num_items(Items.Wood) < 65000000:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(12):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 1000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Pumpkin) > 200000 and num_items(Items.Cactus) < 35000000:
    			farm_cactus()
    		else:
    			n = get_world_size()
    			drones = []
    			for i in range(8):
    				for j in range(4):
    					if i != 0 or j != 0:
    						d = spawn_drone(poly_batch, i * 4, j * 8)
    						if d != None:
    							drones.append(d)
    			poly_batch(0, 0)
    			for d in drones:
    				wait_for(d)
    Changes from the previous revision
      	n = get_world_size()
      	drones = []
    - 	for x in range(n):
    + 	for x in range(n - 1):
      		d = spawn_drone(clear_col, x)
      		if d != None:
      		else:
      			clear_col(x)
    + 	clear_col(n - 1)
      	for d in drones:
      		wait_for(d)
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Carrot) > 500000 and num_items(Items.Pumpkin) < 28000000:
    - 			farm_pumpkins()
    + 		if num_items(Items.Pumpkin) > 200000 and num_items(Items.Cactus) < 35000000:
    + 			farm_cactus()
      		else:
    - 			if num_items(Items.Pumpkin) > 100000 and num_items(Items.Cactus) < 35000000:
    - 				farm_cactus()
    - 			else:
    - 				n = get_world_size()
    - 				drones = []
    - 				for i in range(8):
    - 					for j in range(4):
    - 						if i != 0 or j != 0:
    - 							d = spawn_drone(poly_batch, i * 4, j * 8)
    - 							if d != None:
    - 								drones.append(d)
    - 				poly_batch(0, 0)
    - 				for d in drones:
    - 					wait_for(d)
    + 			n = get_world_size()
    + 			drones = []
    + 			for i in range(8):
    + 				for j in range(4):
    + 					if i != 0 or j != 0:
    + 						d = spawn_drone(poly_batch, i * 4, j * 8)
    + 						if d != None:
    + 							drones.append(d)
    + 			poly_batch(0, 0)
    + 			for d in drones:
    + 				wait_for(d)
    
    Write result the agent saw
    Saved main (379 lines).
    Game time: 3h 7m 2s elapsed, 2h 52m 58s of budget remaining.
    run_program at 3h 07m for 180s (agent saw)
    Ran main for 3m of game time; it is still running.
    Inventory change: cactus +33554432, carrot +39536512, fertilizer -1791, hay +33939584, power -4880.95, pumpkin +720896, water +4419, weird_substance +67663104, wood +77240448.
    Game time: 3h 10m 12s elapsed, 2h 49m 48s of budget remaining.
    Output:
    Warning: Cannot plant Entities.Carrot on Grounds.Grassland.
    In: poly_batch <- poly_step <- ensure_plant
    plant(Entities.Carrot)
         ^^               
    --------------------------------------------------------------------
  34. r333h 14mRan391 lines · +29 −17 · ran 58m 56s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step):
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	drones = []
    	for s in range(4):
    		for t in [-1, 1]:
    			if s != 0 or t != 1:
    				d = spawn_drone(maze_follower, s, t)
    				if d != None:
    					drones.append(d)
    	maze_follower(0, 1)
    	for d in drones:
    		wait_for(d)
    
    def clear_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    		move(North)
    
    def farm_dinosaurs():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(clear_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			clear_col(x)
    	clear_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	change_hat(Hats.Dinosaur_Hat)
    	alive = True
    	while alive:
    		for y in range(n - 1):
    			if not move(North):
    				alive = False
    				break
    		if not alive:
    			break
    		for x in range(n - 1):
    			if not move(East):
    				alive = False
    				break
    			if x % 2 == 0:
    				for i in range(n - 2):
    					if not move(South):
    						alive = False
    						break
    			else:
    				for i in range(n - 2):
    					if not move(North):
    						alive = False
    						break
    			if not alive:
    				break
    		if not alive:
    			break
    		if not move(South):
    			break
    		for x in range(n - 1):
    			if not move(West):
    				alive = False
    				break
    	change_hat(Hats.Straw_Hat)
    
    def poly_step(bx, by):
    	h = num_items(Items.Hay)
    	w = num_items(Items.Wood)
    	c = num_items(Items.Carrot)
    	if h <= w and h <= c:
    		base = Entities.Grass
    	else:
    		if w <= c:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(15):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 3000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Cactus) > 1000000 and num_items(Items.Bone) < 200000000:
    			farm_dinosaurs()
    		else:
    			if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 5000000:
    				solve_maze()
    			else:
    				if num_items(Items.Carrot) > 2000000 and num_items(Items.Pumpkin) < 50000000:
    					farm_pumpkins()
    				else:
    					if num_items(Items.Pumpkin) > 500000 and num_items(Items.Cactus) < 100000000:
    						farm_cactus()
    					else:
    						n = get_world_size()
    						drones = []
    						for i in range(8):
    							for j in range(4):
    								if i != 0 or j != 0:
    									d = spawn_drone(poly_batch, i * 4, j * 8)
    									if d != None:
    										drones.append(d)
    						poly_batch(0, 0)
    						for d in drones:
    							wait_for(d)
    Changes from the previous revision
      
      def poly_step(bx, by):
    - 	if num_items(Items.Hay) < 25000000:
    + 	h = num_items(Items.Hay)
    + 	w = num_items(Items.Wood)
    + 	c = num_items(Items.Carrot)
    + 	if h <= w and h <= c:
      		base = Entities.Grass
      	else:
    - 		if num_items(Items.Wood) < 65000000:
    + 		if w <= c:
      			base = Entities.Tree
      			clear_neighbors(bx, by)
      
      def poly_batch(bx, by):
    - 	for i in range(12):
    + 	for i in range(15):
      		if num_items(Items.Power) < 300:
      			break
      
      while True:
    - 	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 1000:
    + 	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 3000:
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Pumpkin) > 200000 and num_items(Items.Cactus) < 35000000:
    - 			farm_cactus()
    + 		if num_items(Items.Cactus) > 1000000 and num_items(Items.Bone) < 200000000:
    + 			farm_dinosaurs()
      		else:
    - 			n = get_world_size()
    - 			drones = []
    - 			for i in range(8):
    - 				for j in range(4):
    - 					if i != 0 or j != 0:
    - 						d = spawn_drone(poly_batch, i * 4, j * 8)
    - 						if d != None:
    - 							drones.append(d)
    - 			poly_batch(0, 0)
    - 			for d in drones:
    - 				wait_for(d)
    + 			if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 5000000:
    + 				solve_maze()
    + 			else:
    + 				if num_items(Items.Carrot) > 2000000 and num_items(Items.Pumpkin) < 50000000:
    + 					farm_pumpkins()
    + 				else:
    + 					if num_items(Items.Pumpkin) > 500000 and num_items(Items.Cactus) < 100000000:
    + 						farm_cactus()
    + 					else:
    + 						n = get_world_size()
    + 						drones = []
    + 						for i in range(8):
    + 							for j in range(4):
    + 								if i != 0 or j != 0:
    + 									d = spawn_drone(poly_batch, i * 4, j * 8)
    + 									if d != None:
    + 										drones.append(d)
    + 						poly_batch(0, 0)
    + 						for d in drones:
    + 							wait_for(d)
    
    Write result the agent saw
    Saved main (391 lines).
    Game time: 3h 14m 19s elapsed, 2h 45m 41s of budget remaining.
    run_program at 3h 14m for 600s (agent saw)
    Ran main for 10m of game time; it is still running.
    Inventory change: cactus -2624, carrot +2071040, fertilizer +480, hay +1155072, power -685.45, water +15360, wood +19878400.
    Game time: 3h 24m 29s elapsed, 2h 35m 31s of budget remaining.
    Output:
    (none)
  35. r344h 13mRan335 lines · +31 −87 · ran 10m 20s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_follower(start_idx, turn_step, delay):
    	for i in range(delay):
    		do_a_flip()
    	dirs = [North, East, South, West]
    	idx = start_idx
    	while get_entity_type() == Entities.Hedge:
    		idx = (idx + turn_step) % 4
    		while not can_move(dirs[idx]):
    			idx = (idx - turn_step) % 4
    		move(dirs[idx])
    	if get_entity_type() == Entities.Treasure:
    		harvest()
    
    def solve_maze():
    	move_to(0, 0)
    	if can_harvest():
    		harvest()
    	if get_ground_type() != Grounds.Grassland:
    		till()
    	plant(Entities.Bush)
    	n = get_world_size()
    	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    	use_item(Items.Weird_Substance, sub)
    	drones = []
    	for k in range(3):
    		for s in range(4):
    			for t in [-1, 1]:
    				if k != 0 or s != 0 or t != 1:
    					d = spawn_drone(maze_follower, s, t, k)
    					if d != None:
    						drones.append(d)
    	maze_follower(0, 1, 0)
    	for d in drones:
    		wait_for(d)
    
    def poly_step(bx, by):
    	h = num_items(Items.Hay)
    	w = num_items(Items.Wood)
    	c = num_items(Items.Carrot)
    	if h <= w and h <= c:
    		base = Entities.Grass
    	else:
    		if w <= c:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(15):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 3000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 25000000:
    			solve_maze()
    		else:
    			p = num_items(Items.Pumpkin)
    			ca = num_items(Items.Cactus)
    			m_poly = min(num_items(Items.Hay), min(num_items(Items.Wood), num_items(Items.Carrot)))
    			if m_poly < 10000000 or (m_poly <= p and m_poly <= ca):
    				n = get_world_size()
    				drones = []
    				for i in range(8):
    					for j in range(4):
    						if i != 0 or j != 0:
    							d = spawn_drone(poly_batch, i * 4, j * 8)
    							if d != None:
    								drones.append(d)
    				poly_batch(0, 0)
    				for d in drones:
    					wait_for(d)
    			else:
    				if p <= ca and num_items(Items.Carrot) > 5000000:
    					farm_pumpkins()
    				else:
    					if num_items(Items.Pumpkin) > 5000000:
    						farm_cactus()
    					else:
    						farm_pumpkins()
    Changes from the previous revision
      				till()
      
    - def maze_follower(start_idx, turn_step):
    + def maze_follower(start_idx, turn_step, delay):
    + 	for i in range(delay):
    + 		do_a_flip()
      	dirs = [North, East, South, West]
      	idx = start_idx
      	use_item(Items.Weird_Substance, sub)
      	drones = []
    - 	for s in range(4):
    - 		for t in [-1, 1]:
    - 			if s != 0 or t != 1:
    - 				d = spawn_drone(maze_follower, s, t)
    - 				if d != None:
    - 					drones.append(d)
    - 	maze_follower(0, 1)
    - 	for d in drones:
    - 		wait_for(d)
    - 
    - def clear_col(x):
    - 	move_to(x, 0)
    - 	n = get_world_size()
    - 	for y in range(n):
    - 		if can_harvest():
    - 			harvest()
    - 		if get_ground_type() != Grounds.Grassland:
    - 			till()
    - 		else:
    - 			if get_entity_type() != Entities.Grass:
    - 				till()
    - 				till()
    - 		move(North)
    - 
    - def farm_dinosaurs():
    - 	n = get_world_size()
    - 	drones = []
    - 	for x in range(n - 1):
    - 		d = spawn_drone(clear_col, x)
    - 		if d != None:
    - 			drones.append(d)
    - 		else:
    - 			clear_col(x)
    - 	clear_col(n - 1)
    + 	for k in range(3):
    + 		for s in range(4):
    + 			for t in [-1, 1]:
    + 				if k != 0 or s != 0 or t != 1:
    + 					d = spawn_drone(maze_follower, s, t, k)
    + 					if d != None:
    + 						drones.append(d)
    + 	maze_follower(0, 1, 0)
      	for d in drones:
      		wait_for(d)
    - 	move_to(0, 0)
    - 	change_hat(Hats.Dinosaur_Hat)
    - 	alive = True
    - 	while alive:
    - 		for y in range(n - 1):
    - 			if not move(North):
    - 				alive = False
    - 				break
    - 		if not alive:
    - 			break
    - 		for x in range(n - 1):
    - 			if not move(East):
    - 				alive = False
    - 				break
    - 			if x % 2 == 0:
    - 				for i in range(n - 2):
    - 					if not move(South):
    - 						alive = False
    - 						break
    - 			else:
    - 				for i in range(n - 2):
    - 					if not move(North):
    - 						alive = False
    - 						break
    - 			if not alive:
    - 				break
    - 		if not alive:
    - 			break
    - 		if not move(South):
    - 			break
    - 		for x in range(n - 1):
    - 			if not move(West):
    - 				alive = False
    - 				break
    - 	change_hat(Hats.Straw_Hat)
      
      def poly_step(bx, by):
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Cactus) > 1000000 and num_items(Items.Bone) < 200000000:
    - 			farm_dinosaurs()
    + 		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 25000000:
    + 			solve_maze()
      		else:
    - 			if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 5000000:
    - 				solve_maze()
    + 			p = num_items(Items.Pumpkin)
    + 			ca = num_items(Items.Cactus)
    + 			m_poly = min(num_items(Items.Hay), min(num_items(Items.Wood), num_items(Items.Carrot)))
    + 			if m_poly < 10000000 or (m_poly <= p and m_poly <= ca):
    + 				n = get_world_size()
    + 				drones = []
    + 				for i in range(8):
    + 					for j in range(4):
    + 						if i != 0 or j != 0:
    + 							d = spawn_drone(poly_batch, i * 4, j * 8)
    + 							if d != None:
    + 								drones.append(d)
    + 				poly_batch(0, 0)
    + 				for d in drones:
    + 					wait_for(d)
      			else:
    - 				if num_items(Items.Carrot) > 2000000 and num_items(Items.Pumpkin) < 50000000:
    + 				if p <= ca and num_items(Items.Carrot) > 5000000:
      					farm_pumpkins()
      				else:
    - 					if num_items(Items.Pumpkin) > 500000 and num_items(Items.Cactus) < 100000000:
    + 					if num_items(Items.Pumpkin) > 5000000:
      						farm_cactus()
      					else:
    - 						n = get_world_size()
    - 						drones = []
    - 						for i in range(8):
    - 							for j in range(4):
    - 								if i != 0 or j != 0:
    - 									d = spawn_drone(poly_batch, i * 4, j * 8)
    - 									if d != None:
    - 										drones.append(d)
    - 						poly_batch(0, 0)
    - 						for d in drones:
    - 							wait_for(d)
    + 						farm_pumpkins()
    
    Write result the agent saw
    Saved main (335 lines).
    Game time: 4h 13m 35s elapsed, 1h 46m 25s of budget remaining.
    run_program at 4h 13m for 600s (agent saw)
    Ran main for 10m of game time; it is still running.
    Inventory change: bone +128, carrot -1024, fertilizer +480, gold +1081344, hay +535552, power -4778.63, water +14255, weird_substance -33792.
    Game time: 4h 23m 45s elapsed, 1h 36m 15s of budget remaining.
    Output:
    (none)
  36. r354h 24mRan343 lines · +39 −31 · ran 1m 20s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_tile_worker(tx, ty):
    	move_to(tx, ty)
    	while True:
    		e = get_entity_type()
    		if e == Entities.Treasure:
    			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    				harvest()
    				return
    			use_item(Items.Weird_Substance, 160)
    		else:
    			if e != Entities.Hedge:
    				return
    
    def farm_gold_fast():
    	set_world_size(5)
    	drones = []
    	for x in range(5):
    		for y in range(5):
    			if x != 0 or y != 0:
    				d = spawn_drone(maze_tile_worker, x, y)
    				if d != None:
    					drones.append(d)
    	move_to(0, 0)
    	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) > 1000:
    		e = get_entity_type()
    		if e != Entities.Hedge and e != Entities.Treasure:
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(Entities.Bush)
    			use_item(Items.Weird_Substance, 160)
    		if get_entity_type() == Entities.Treasure:
    			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    				harvest()
    				break
    			use_item(Items.Weird_Substance, 160)
    	if get_entity_type() == Entities.Hedge or get_entity_type() == Entities.Treasure:
    		harvest()
    	for d in drones:
    		wait_for(d)
    	set_world_size(32)
    
    def poly_step(bx, by):
    	h = num_items(Items.Hay)
    	w = num_items(Items.Wood)
    	c = num_items(Items.Carrot)
    	if h <= w and h <= c:
    		base = Entities.Grass
    	else:
    		if w <= c:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(15):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 3000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 50000000:
    			farm_gold_fast()
    		else:
    			p = num_items(Items.Pumpkin)
    			ca = num_items(Items.Cactus)
    			m_poly = min(num_items(Items.Hay), min(num_items(Items.Wood), num_items(Items.Carrot)))
    			if m_poly < 10000000 or (m_poly <= p and m_poly <= ca):
    				n = get_world_size()
    				drones = []
    				for i in range(8):
    					for j in range(4):
    						if i != 0 or j != 0:
    							d = spawn_drone(poly_batch, i * 4, j * 8)
    							if d != None:
    								drones.append(d)
    				poly_batch(0, 0)
    				for d in drones:
    					wait_for(d)
    			else:
    				if p <= ca and num_items(Items.Carrot) > 5000000:
    					farm_pumpkins()
    				else:
    					if num_items(Items.Pumpkin) > 5000000:
    						farm_cactus()
    					else:
    						farm_pumpkins()
    Changes from the previous revision
      				till()
      
    - def maze_follower(start_idx, turn_step, delay):
    - 	for i in range(delay):
    - 		do_a_flip()
    - 	dirs = [North, East, South, West]
    - 	idx = start_idx
    - 	while get_entity_type() == Entities.Hedge:
    - 		idx = (idx + turn_step) % 4
    - 		while not can_move(dirs[idx]):
    - 			idx = (idx - turn_step) % 4
    - 		move(dirs[idx])
    - 	if get_entity_type() == Entities.Treasure:
    - 		harvest()
    + def maze_tile_worker(tx, ty):
    + 	move_to(tx, ty)
    + 	while True:
    + 		e = get_entity_type()
    + 		if e == Entities.Treasure:
    + 			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    + 				harvest()
    + 				return
    + 			use_item(Items.Weird_Substance, 160)
    + 		else:
    + 			if e != Entities.Hedge:
    + 				return
      
    - def solve_maze():
    + def farm_gold_fast():
    + 	set_world_size(5)
    + 	drones = []
    + 	for x in range(5):
    + 		for y in range(5):
    + 			if x != 0 or y != 0:
    + 				d = spawn_drone(maze_tile_worker, x, y)
    + 				if d != None:
    + 					drones.append(d)
      	move_to(0, 0)
    - 	if can_harvest():
    + 	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) > 1000:
    + 		e = get_entity_type()
    + 		if e != Entities.Hedge and e != Entities.Treasure:
    + 			if can_harvest():
    + 				harvest()
    + 			if get_ground_type() != Grounds.Grassland:
    + 				till()
    + 			plant(Entities.Bush)
    + 			use_item(Items.Weird_Substance, 160)
    + 		if get_entity_type() == Entities.Treasure:
    + 			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    + 				harvest()
    + 				break
    + 			use_item(Items.Weird_Substance, 160)
    + 	if get_entity_type() == Entities.Hedge or get_entity_type() == Entities.Treasure:
      		harvest()
    - 	if get_ground_type() != Grounds.Grassland:
    - 		till()
    - 	plant(Entities.Bush)
    - 	n = get_world_size()
    - 	sub = n * 2**(num_unlocked(Unlocks.Mazes) - 1)
    - 	use_item(Items.Weird_Substance, sub)
    - 	drones = []
    - 	for k in range(3):
    - 		for s in range(4):
    - 			for t in [-1, 1]:
    - 				if k != 0 or s != 0 or t != 1:
    - 					d = spawn_drone(maze_follower, s, t, k)
    - 					if d != None:
    - 						drones.append(d)
    - 	maze_follower(0, 1, 0)
      	for d in drones:
      		wait_for(d)
    + 	set_world_size(32)
      
      def poly_step(bx, by):
      		farm_sunflowers()
      	else:
    - 		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 25000000:
    - 			solve_maze()
    + 		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 50000000:
    + 			farm_gold_fast()
      		else:
      			p = num_items(Items.Pumpkin)
    
    Write result the agent saw
    Saved main (343 lines).
    Game time: 4h 24m 35s elapsed, 1h 35m 25s of budget remaining.
    run_program at 4h 24m for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +48, hay +512, power -62.74, water +1536, weird_substance -160.
    Game time: 4h 25m 45s elapsed, 1h 34m 15s of budget remaining.
    Output:
    (none)
  37. r364h 26mRan346 lines · +7 −4 · ran 1m 10s
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_tile_worker(tx, ty):
    	move_to(tx, ty)
    	while True:
    		e = get_entity_type()
    		if e == Entities.Treasure:
    			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    				harvest()
    				return
    			if not use_item(Items.Weird_Substance, 160):
    				harvest()
    		else:
    			if e != Entities.Hedge:
    				if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    					return
    
    def farm_gold_fast():
    	set_world_size(5)
    	drones = []
    	for x in range(5):
    		for y in range(5):
    			if x != 0 or y != 0:
    				d = spawn_drone(maze_tile_worker, x, y)
    				if d != None:
    					drones.append(d)
    	move_to(0, 0)
    	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) >= 500:
    		e = get_entity_type()
    		if e != Entities.Hedge and e != Entities.Treasure:
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(Entities.Bush)
    			use_item(Items.Weird_Substance, 160)
    		if get_entity_type() == Entities.Treasure:
    			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    				harvest()
    				break
    			if not use_item(Items.Weird_Substance, 160):
    				harvest()
    	if get_entity_type() == Entities.Hedge or get_entity_type() == Entities.Treasure:
    		harvest()
    	for d in drones:
    		wait_for(d)
    	set_world_size(32)
    
    def poly_step(bx, by):
    	h = num_items(Items.Hay)
    	w = num_items(Items.Wood)
    	c = num_items(Items.Carrot)
    	if h <= w and h <= c:
    		base = Entities.Grass
    	else:
    		if w <= c:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(15):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 3000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 50000000:
    			farm_gold_fast()
    		else:
    			p = num_items(Items.Pumpkin)
    			ca = num_items(Items.Cactus)
    			m_poly = min(num_items(Items.Hay), min(num_items(Items.Wood), num_items(Items.Carrot)))
    			if m_poly < 10000000 or (m_poly <= p and m_poly <= ca):
    				n = get_world_size()
    				drones = []
    				for i in range(8):
    					for j in range(4):
    						if i != 0 or j != 0:
    							d = spawn_drone(poly_batch, i * 4, j * 8)
    							if d != None:
    								drones.append(d)
    				poly_batch(0, 0)
    				for d in drones:
    					wait_for(d)
    			else:
    				if p <= ca and num_items(Items.Carrot) > 5000000:
    					farm_pumpkins()
    				else:
    					if num_items(Items.Pumpkin) > 5000000:
    						farm_cactus()
    					else:
    						farm_pumpkins()
    Changes from the previous revision
      				harvest()
      				return
    - 			use_item(Items.Weird_Substance, 160)
    + 			if not use_item(Items.Weird_Substance, 160):
    + 				harvest()
      		else:
      			if e != Entities.Hedge:
    - 				return
    + 				if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    + 					return
      
      def farm_gold_fast():
      					drones.append(d)
      	move_to(0, 0)
    - 	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) > 1000:
    + 	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) >= 500:
      		e = get_entity_type()
      		if e != Entities.Hedge and e != Entities.Treasure:
      				harvest()
      				break
    - 			use_item(Items.Weird_Substance, 160)
    + 			if not use_item(Items.Weird_Substance, 160):
    + 				harvest()
      	if get_entity_type() == Entities.Hedge or get_entity_type() == Entities.Treasure:
      		harvest()
    
    Write result the agent saw
    Saved main (346 lines).
    Game time: 4h 26m 15s elapsed, 1h 33m 45s of budget remaining.
    run_program at 4h 26m for 60s (agent saw)
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +48, gold +1357600, hay +512, power -1504.16, water +1536, weird_substance -271680.
    Game time: 4h 27m 25s elapsed, 1h 32m 35s of budget remaining.
    Output:
    (none)
  38. r374h 27mRanFinal339 lines · +5 −12 · ran 1h 32m
    def move_to(tx, ty):
    	n = get_world_size()
    	cx = get_pos_x()
    	cy = get_pos_y()
    	dx = (tx - cx) % n
    	if dx <= n // 2:
    		for i in range(dx):
    			move(East)
    	else:
    		for i in range(n - dx):
    			move(West)
    	dy = (ty - cy) % n
    	if dy <= n // 2:
    		for i in range(dy):
    			move(North)
    	else:
    		for i in range(n - dy):
    			move(South)
    
    def do_water():
    	if get_water() < 0.75 and num_items(Items.Water) > 0:
    		use_item(Items.Water)
    
    def ensure_plant(p):
    	if p == Entities.Grass:
    		if get_ground_type() != Grounds.Grassland:
    			till()
    		else:
    			if get_entity_type() != Entities.Grass:
    				till()
    				till()
    	else:
    		if p == Entities.Carrot:
    			if get_ground_type() != Grounds.Soil:
    				till()
    			plant(Entities.Carrot)
    		else:
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(p)
    
    def clear_neighbors(bx, by):
    	n = get_world_size()
    	for pos in [(bx, (by + 1) % n), ((bx + 1) % n, by), (bx, (by - 1) % n), ((bx - 1) % n, by)]:
    		nx, ny = pos
    		move_to(nx, ny)
    		if get_entity_type() == Entities.Tree:
    			if can_harvest():
    				harvest()
    			else:
    				till()
    				till()
    
    def maze_tile_worker(tx, ty):
    	move_to(tx, ty)
    	while True:
    		if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500 or num_items(Items.Power) < 500:
    			if get_entity_type() == Entities.Treasure or get_entity_type() == Entities.Hedge:
    				harvest()
    			return
    		if get_entity_type() == Entities.Treasure:
    			if not use_item(Items.Weird_Substance, 160):
    				harvest()
    
    def farm_gold_fast():
    	set_world_size(5)
    	drones = []
    	for x in range(5):
    		for y in range(5):
    			if x != 0 or y != 0:
    				d = spawn_drone(maze_tile_worker, x, y)
    				if d != None:
    					drones.append(d)
    	move_to(0, 0)
    	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) >= 500 and num_items(Items.Power) >= 500:
    		e = get_entity_type()
    		if e != Entities.Hedge and e != Entities.Treasure:
    			if can_harvest():
    				harvest()
    			if get_ground_type() != Grounds.Grassland:
    				till()
    			plant(Entities.Bush)
    			use_item(Items.Weird_Substance, 160)
    		if get_entity_type() == Entities.Treasure:
    			if not use_item(Items.Weird_Substance, 160):
    				harvest()
    	if get_entity_type() == Entities.Hedge or get_entity_type() == Entities.Treasure:
    		harvest()
    	for d in drones:
    		wait_for(d)
    	set_world_size(32)
    
    def poly_step(bx, by):
    	h = num_items(Items.Hay)
    	w = num_items(Items.Wood)
    	c = num_items(Items.Carrot)
    	if h <= w and h <= c:
    		base = Entities.Grass
    	else:
    		if w <= c:
    			base = Entities.Tree
    			clear_neighbors(bx, by)
    		else:
    			base = Entities.Carrot
    	move_to(bx, by)
    	if can_harvest():
    		harvest()
    	ensure_plant(base)
    	comp = get_companion()
    	if comp != None:
    		c_type, (cx, cy) = comp
    		move_to(cx, cy)
    		if can_harvest():
    			harvest()
    		ensure_plant(c_type)
    		move_to(bx, by)
    	while not can_harvest():
    		do_water()
    		if num_items(Items.Fertilizer) > 5 and num_items(Items.Weird_Substance) < 50000:
    			use_item(Items.Fertilizer)
    		else:
    			if base != Entities.Grass and num_items(Items.Fertilizer) > 50:
    				use_item(Items.Fertilizer)
    	harvest()
    
    def poly_batch(bx, by):
    	for i in range(15):
    		if num_items(Items.Power) < 300:
    			break
    		poly_step(bx, by)
    
    def sf_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Sunflower)
    		move(North)
    
    def sf_harvest_col(x, p):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if get_entity_type() == Entities.Sunflower and measure() == p:
    			while not can_harvest():
    				do_water()
    			harvest()
    		move(North)
    
    def farm_sunflowers():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(sf_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			sf_plant_col(x)
    	sf_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	for p in [15, 14, 13, 12, 11, 10, 9, 8, 7]:
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(sf_harvest_col, x, p)
    			if d != None:
    				drones.append(d)
    			else:
    				sf_harvest_col(x, p)
    		sf_harvest_col(n - 1, p)
    		for d in drones:
    			wait_for(d)
    
    def pk_plant_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		do_water()
    		plant(Entities.Pumpkin)
    		move(North)
    
    def pk_check_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	ready = True
    	for y in range(n):
    		if get_ground_type() != Grounds.Soil:
    			till()
    		if get_entity_type() != Entities.Pumpkin:
    			if can_harvest():
    				harvest()
    			plant(Entities.Pumpkin)
    			do_water()
    			ready = False
    		else:
    			if not can_harvest():
    				do_water()
    				ready = False
    		move(North)
    	return ready
    
    def farm_pumpkins():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(pk_plant_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			pk_plant_col(x)
    	pk_plant_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	while True:
    		all_ready = True
    		drones = []
    		for x in range(n - 1):
    			d = spawn_drone(pk_check_col, x)
    			if d != None:
    				drones.append(d)
    			else:
    				if not pk_check_col(x):
    					all_ready = False
    		if not pk_check_col(n - 1):
    			all_ready = False
    		for d in drones:
    			if not wait_for(d):
    				all_ready = False
    		if all_ready:
    			harvest()
    			return
    
    def cc_plant_sort_col(x):
    	move_to(x, 0)
    	n = get_world_size()
    	for y in range(n):
    		if can_harvest():
    			harvest()
    		if get_ground_type() != Grounds.Soil:
    			till()
    		plant(Entities.Cactus)
    		move(North)
    	for pass_num in range(n):
    		move_to(x, 0)
    		swapped = False
    		for y in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(North)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(North)
    				swapped = True
    			move(North)
    		if not swapped:
    			break
    
    def cc_sort_row(y):
    	n = get_world_size()
    	for pass_num in range(n):
    		move_to(0, y)
    		swapped = False
    		for x in range(n - 1 - pass_num):
    			while not can_harvest():
    				do_water()
    			m1 = measure()
    			m2 = measure(East)
    			if m1 != None and m2 != None and m1 > m2:
    				swap(East)
    				swapped = True
    			move(East)
    		if not swapped:
    			break
    
    def farm_cactus():
    	n = get_world_size()
    	drones = []
    	for x in range(n - 1):
    		d = spawn_drone(cc_plant_sort_col, x)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_plant_sort_col(x)
    	cc_plant_sort_col(n - 1)
    	for d in drones:
    		wait_for(d)
    	drones = []
    	for y in range(n - 1):
    		d = spawn_drone(cc_sort_row, y)
    		if d != None:
    			drones.append(d)
    		else:
    			cc_sort_row(y)
    	cc_sort_row(n - 1)
    	for d in drones:
    		wait_for(d)
    	move_to(0, 0)
    	harvest()
    
    change_hat(Hats.Straw_Hat)
    
    while True:
    	if num_items(Items.Carrot) > 5000 and num_items(Items.Power) < 3000:
    		farm_sunflowers()
    	else:
    		if num_items(Items.Weird_Substance) > 50000 and num_items(Items.Gold) < 50000000:
    			farm_gold_fast()
    		else:
    			p = num_items(Items.Pumpkin)
    			ca = num_items(Items.Cactus)
    			m_poly = min(num_items(Items.Hay), min(num_items(Items.Wood), num_items(Items.Carrot)))
    			if m_poly < 10000000 or (m_poly <= p and m_poly <= ca):
    				n = get_world_size()
    				drones = []
    				for i in range(8):
    					for j in range(4):
    						if i != 0 or j != 0:
    							d = spawn_drone(poly_batch, i * 4, j * 8)
    							if d != None:
    								drones.append(d)
    				poly_batch(0, 0)
    				for d in drones:
    					wait_for(d)
    			else:
    				if p <= ca and num_items(Items.Carrot) > 5000000:
    					farm_pumpkins()
    				else:
    					if num_items(Items.Pumpkin) > 5000000:
    						farm_cactus()
    					else:
    						farm_pumpkins()
    Changes from the previous revision
      	move_to(tx, ty)
      	while True:
    - 		e = get_entity_type()
    - 		if e == Entities.Treasure:
    - 			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    + 		if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500 or num_items(Items.Power) < 500:
    + 			if get_entity_type() == Entities.Treasure or get_entity_type() == Entities.Hedge:
      				harvest()
    - 				return
    + 			return
    + 		if get_entity_type() == Entities.Treasure:
      			if not use_item(Items.Weird_Substance, 160):
      				harvest()
    - 		else:
    - 			if e != Entities.Hedge:
    - 				if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    - 					return
      
      def farm_gold_fast():
      					drones.append(d)
      	move_to(0, 0)
    - 	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) >= 500:
    + 	while num_items(Items.Gold) < 50000000 and num_items(Items.Weird_Substance) >= 500 and num_items(Items.Power) >= 500:
      		e = get_entity_type()
      		if e != Entities.Hedge and e != Entities.Treasure:
      			use_item(Items.Weird_Substance, 160)
      		if get_entity_type() == Entities.Treasure:
    - 			if num_items(Items.Gold) >= 50000000 or num_items(Items.Weird_Substance) < 500:
    - 				harvest()
    - 				break
      			if not use_item(Items.Weird_Substance, 160):
      				harvest()
    
    Write result the agent saw
    Saved main (339 lines).
    Game time: 4h 27m 45s elapsed, 1h 32m 15s of budget remaining.
    run_program at 4h 27m for 2400s (agent saw)
    Ran main for 7m 23s of game time; it is still running.
    Inventory change: carrot -2048, fertilizer +354, gold +8937600, hay +1041408, power +5258.74, water +9093, weird_substance -1787840.
    Game time: 4h 35m 18s elapsed, 1h 24m 42s of budget remaining.
    Output:
    (none)
test_hat.py1 write · 1 ran · first at 1h 15m
  1. r11h 15mRanFinal1 lines · ran 0s
    change_hat(Hats.Straw_Hat)
    Write result the agent saw
    Saved test_hat (1 lines).
    Game time: 1h 15m 21s elapsed, 4h 44m 39s of budget remaining.
    run_program at 1h 15m for 5s (agent saw)
    Ran test_hat for 0s of game time; it finished.
    Inventory change: bone +40898.
    Game time: 1h 15m 31s elapsed, 4h 44m 29s of budget remaining.
    Output:
    (none)
log1 said · 0 thought · 314 tool calls

Step by step

  1. 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)
  2. 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; 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…
  3. 20slist_programs
    result
    No programs yet.
    Game time: 30s elapsed, 5h 59m 30s of budget remaining.
  4. 30swrite_program name="main" · evidence
    result
    Saved main (2 lines).
    Game time: 40s elapsed, 5h 59m 20s of budget remaining.
  5. 40swrite_program name="main" · evidence
    result
    Saved main (10 lines).
    Game time: 50s elapsed, 5h 59m 10s of budget remaining.
  6. 50srun_program name="main" seconds=20
    result
    Ran main for 5s of game time; it finished.
    Inventory change: hay +10.
    Game time: 1m 5s elapsed, 5h 58m 55s of budget remaining.
    Output:
    (none)
  7. 1m 05sbuy_upgrade upgrades=["loops"] · evidence
    result
    Bought loops, now level 1. Paid hay 5. Its tutorial is docs page docs/scripting/while.md.
    Game time: 1m 15s elapsed, 5h 58m 45s of budget remaining.
  8. 1m 15swrite_program name="main" · evidence
    result
    Saved main (2 lines).
    Game time: 1m 25s elapsed, 5h 58m 35s of budget remaining.
  9. 1m 25srun_program name="main" seconds=20
    result
    Ran main for 20s of game time; it is still running.
    Inventory change: hay +40.
    Game time: 1m 55s elapsed, 5h 58m 5s of budget remaining.
    Output:
    (none)
  10. 1m 55sbuy_upgrade upgrades=["speed"] · evidence
    result
    Bought speed, now level 1. Paid hay 20. Its tutorial is docs page docs/unlocks/speed.md.
    Game time: 2m 5s elapsed, 5h 57m 55s of budget remaining.
  11. 2m 05swait seconds=60 until_affordable="plant"
    result
    Waited 1m (time up). Program: main running.
    Inventory change: no change.
    Game time: 3m 15s elapsed, 5h 56m 45s of budget remaining.
  12. 3m 15sobserve
    result
    Game time: 3m 25s elapsed, 5h 56m 35s of budget remaining.
    Program: main (running).
    Inventory: hay 46.
    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)
  13. 3m 25sdocs_read path="docs/unlocks/speed.md" show_hints=true
    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…
  14. 3m 35swrite_program name="main" · evidence
    result
    Stop the program before editing it.
  15. 3m 45srun_program name="main" seconds=25
    result
    Ran main for 25s of game time; it is still running.
    Inventory change: no change.
    Game time: 4m 20s elapsed, 5h 55m 40s of budget remaining.
    Output:
    (none)
  16. 4m 20sbuy_upgrade upgrades=["expand","plant"] · evidence
    result
    Bought expand, now level 1. Paid hay 30. Its tutorial is docs page docs/unlocks/expand_1.md.
    Could not buy plant: Not enough resources.
    Game time: 4m 30s elapsed, 5h 55m 30s of budget remaining.
  17. 4m 30sstop_program
    result
    Program stopped.
    Game time: 4m 40s elapsed, 5h 55m 20s of budget remaining.
  18. 4m 40swrite_program name="main" · evidence
    result
    Saved main (4 lines).
    Game time: 4m 50s elapsed, 5h 55m 10s of budget remaining.
  19. 4m 50srun_program name="main" seconds=20
    result
    Ran main for 20s of game time; it is still running.
    Inventory change: hay +30.
    Game time: 5m 20s elapsed, 5h 54m 40s of budget remaining.
    Output:
    (none)
  20. 5m 20sbuy_upgrade upgrades=["plant"] · evidence
    result
    Bought plant, now level 1. Paid hay 50. Its tutorial is docs page docs/unlocks/plant.md.
    Game time: 5m 30s elapsed, 5h 54m 30s of budget remaining.
  21. 5m 30sresearch
    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; available, not affordable
      ## Carrots Till the soil and plant carrots. till() plant(Entities.Carrot)
    costs…
  22. 5m 40sdocs_read path="docs/unlocks/plant.md" show_hints=true
    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…
  23. 5m 50sdocs_read path="docs/unlocks/expand_1.md" show_hints=true
    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…
  24. 6m 00sstop_program
    result
    Program stopped.
    Game time: 6m 10s elapsed, 5h 53m 50s of budget remaining.
  25. 6m 10swrite_program name="main" · evidence
    result
    Saved main (12 lines).
    Game time: 6m 20s elapsed, 5h 53m 40s of budget remaining.
  26. 6m 20srun_program name="main" seconds=100
    result
    Ran main for 1m 40s of game time; it is still running.
    Inventory change: hay +153, wood +73.
    Game time: 8m 10s elapsed, 5h 51m 50s of budget remaining.
    Output:
    (none)
  27. 8m 10swait seconds=40 until_resources={"hay":250,"wood":100}
    result
    Waited 10s (hay reached 251). Program: main running.
    Inventory change: hay +14, wood +4.
    Game time: 8m 30s elapsed, 5h 51m 30s of budget remaining.
  28. 8m 30sbuy_upgrade upgrades=["speed","expand","operators","senses","carrots"] · evidence
    result
    Bought speed, now level 2. Paid wood 20. Its tutorial is docs page docs/unlocks/speed.md.
    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.
    Bought senses, now level 1. Paid hay 100. Its tutorial is docs page docs/unlocks/senses.md.
    Could not buy c…
  29. 8m 40sstop_program
    result
    Program stopped.
    Game time: 8m 50s elapsed, 5h 51m 10s of budget remaining.
  30. 8m 50swrite_program name="main" · evidence
    result
    Saved main (13 lines).
    Game time: 9m elapsed, 5h 51m of budget remaining.
  31. 9m 00srun_program name="main" seconds=35
    result
    Ran main for 35s of game time; it is still running.
    Inventory change: hay +33, wood +48.
    Game time: 9m 45s elapsed, 5h 50m 15s of budget remaining.
    Output:
    (none)
  32. 9m 45sbuy_upgrade upgrades=["carrots"] · evidence
    result
    Bought carrots, now level 1. Paid wood 50. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 9m 55s elapsed, 5h 50m 5s of budget remaining.
  33. 9m 55sdocs_read path="docs/unlocks/carrots.md" show_hints=true
    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…
  34. 10m 05sdocs_read path="docs/unlocks/senses.md" show_hints=true
    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…
  35. 10m 15sresearch
    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; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of c…
  36. 10m 25sstop_program
    result
    Program stopped.
    Game time: 10m 35s elapsed, 5h 49m 25s of budget remaining.
  37. 10m 35swrite_program name="main" · evidence
    result
    Saved main (18 lines).
    Game time: 10m 45s elapsed, 5h 49m 15s of budget remaining.
  38. 10m 45srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +36, hay +49, wood +64.
    Game time: 11m 55s elapsed, 5h 48m 5s of budget remaining.
    Output:
    (none)
  39. 11m 55swait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: carrot +181, hay +239, wood +244.
    Game time: 17m 5s elapsed, 5h 42m 55s of budget remaining.
  40. 17m 05sbuy_upgrade upgrades=["variables","functions","speed","trees","watering","expand"] · evidence
    result
    Bought variables, now level 1. Paid carrot 35. Its tutorial is docs page docs/scripting/variables.md.
    Bought functions, now level 1. Paid carrot 40. Its tutorial is docs page docs/scripting/functions.md.
    Bought speed, now level 3. Paid wood 50, carrot 50. 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/tree…
  41. 17m 15sresearch
    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; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of c…
  42. 17m 25sdocs_read path="docs/unlocks/trees.md" show_hints=true
    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…
  43. 17m 35sdocs_read path="docs/unlocks/watering.md" show_hints=true
    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…
  44. 17m 45sbuy_upgrade upgrades=["trees"] · evidence
    result
    Bought trees, now level 2. Paid hay 300. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 17m 55s elapsed, 5h 42m 5s of budget remaining.
  45. 17m 55sstop_program
    result
    Program stopped.
    Game time: 18m 5s elapsed, 5h 41m 55s of budget remaining.
  46. 18m 05swrite_program name="main" · evidence
    result
    Saved main (22 lines).
    Game time: 18m 15s elapsed, 5h 41m 45s of budget remaining.
  47. 18m 15srun_program name="main" seconds=120
    result
    Ran main for 2m of game time; it is still running.
    Inventory change: carrot +155, hay +62, water -7, wood +2377.
    Game time: 20m 25s elapsed, 5h 39m 35s of budget remaining.
    Output:
    (none)
  48. 20m 25sbuy_upgrade upgrades=["carrots","watering","expand"] · evidence
    result
    Bought carrots, now level 2. Paid wood 250. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought watering, now level 2. Paid wood 200. Its tutorial is docs page docs/unlocks/watering.md.
    Bought expand, now level 4. Paid wood 100, carrot 50. Its tutorial is docs page docs/unlocks/expand_1.md.
    Game time: 20m 35s elapsed, 5h 39m 25s of budget remaining.
  49. 20m 35sresearch
    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; can buy now; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrots. 200% …
  50. 20m 45sobserve
    result
    Game time: 20m 55s elapsed, 5h 39m 5s of budget remaining.
    Program: main (running).
    Inventory: hay 234, wood 2302, carrot 185.
    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  _Tr3  #Ca3  _Tr2
    y= 4  _Tr2  _Gr3  _T…
  51. 20m 55swait seconds=60 until_resources={"hay":300}
    result
    Waited 1m (time up). Program: main running.
    Inventory change: carrot +110, hay -22, wood +1412.
    Game time: 22m 5s elapsed, 5h 37m 55s of budget remaining.
  52. 22m 05sbuy_upgrade upgrades=["grass","pumpkins","watering","fertilizer"] · evidence
    result
    Could not buy grass: Not enough resources.
    Bought pumpkins, now level 1. Paid wood 500, carrot 200. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Bought watering, now level 3. Paid wood 800. Its tutorial is docs page docs/unlocks/watering.md.
    Bought fertilizer, now level 1. Paid wood 500. Its tutorial is docs page docs/unlocks/fertilizer.md.
    Game time: 22m 15s elapsed, 5h 37m 45s of budget r…
  53. 22m 15sdocs_read path="docs/unlocks/pumpkins.md" show_hints=true
    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…
  54. 22m 25sdocs_read path="docs/unlocks/fertilizer.md" show_hints=true
    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…
  55. 22m 35sdocs_list
    result
    docs/home.md  General Info
    unlocks/auto_unlock  Auto Unlock
    unlocks/cactus  Cactus
    unlocks/carrots  Carrots
    docs/unlocks/carrots.md  Carrots
    unlocks/costs  Costs
    unlocks/debug  Debug
    unlocks/debug_2  Debug_2
    unlocks/dictionaries  Dictionaries
    unlocks/dinosaurs  Dinosaurs
    unlocks/expand  Expand
    docs/unlocks/expand_1.md  Expand 1
    unlocks/fertilizer  Fertilizer
    docs/unlocks/fertilizer.md  Fertilizer
    …
  56. 22m 45sdocs_read path="objects/carrot" show_hints=true
    result
    ## Carrot
    Carrots!
    
    Base growth time between 4.8 and 7.2 seconds.
    Can grow on soil.
    
    ### Plant Cost [Current cost: hay=2, wood=2]
    
    For more related information see: [Carrots](docs/unlocks/carrots.md)
    Game time: 22m 55s elapsed, 5h 37m 5s of budget remaining.
  57. 22m 55sdocs_read path="objects/pumpkin" show_hints=true
    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: 23m 5s elapsed, 5h 36m 55s of budget remaining.
  58. 23m 05sdocs_read path="objects/dead_pumpkin" show_hints=true
    result
    ## Dead_Pumpkin
    One in five pumpkins dies when it grows up, leaving behind a dead pumpkin. Dead pumpkins are useless and disappear when something new is planted.
    
    For more related information see: [Pumpkins](docs/unlocks/pumpkins.md)
    Game time: 23m 15s elapsed, 5h 36m 45s of budget remaining.
  59. 23m 15sdocs_read path="docs/unlocks/expand_2.md" show_hints=true
    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…
  60. 23m 25sstop_program
    result
    Program stopped.
    Game time: 23m 35s elapsed, 5h 36m 25s of budget remaining.
  61. 23m 35swrite_program name="main" · evidence
    result
    Saved main (22 lines).
    Game time: 23m 45s elapsed, 5h 36m 15s of budget remaining.
  62. 23m 45srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +40, fertilizer +6, hay +106, water -8, wood +970.
    Game time: 24m 55s elapsed, 5h 35m 5s of budget remaining.
    Output:
    (none)
  63. 24m 55sbuy_upgrade upgrades=["grass"] · evidence
    result
    Could not buy grass: Not enough resources.
  64. 25m 05swait seconds=60 until_resources={"hay":300}
    result
    Waited 15s (hay reached 303). Program: main running.
    Inventory change: fertilizer +1, hay +29, wood +360.
    Game time: 25m 29s elapsed, 5h 34m 31s of budget remaining.
  65. 25m 29sbuy_upgrade upgrades=["grass"] · evidence
    result
    Bought grass, now level 2. Paid hay 300.
    Game time: 25m 39s elapsed, 5h 34m 21s of budget remaining.
  66. 25m 39sresearch
    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…
  67. 25m 49sbuy_upgrade upgrades=["grass","carrots","fertilizer"] · evidence
    result
    Bought grass, now level 3. Paid wood 500.
    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: 25m 59s elapsed, 5h 34m 1s of budget remaining.
  68. 25m 59sresearch
    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 …
  69. 26m 09sbuy_upgrade upgrades=["grass"] · evidence
    result
    Bought grass, now level 4. Paid wood 2500.
    Game time: 26m 19s elapsed, 5h 33m 41s of budget remaining.
  70. 26m 19swait seconds=60 until_resources={"hay":1200}
    result
    Waited 54s (hay reached 1214). Program: main running.
    Inventory change: fertilizer +11, hay +816, wood +1300.
    Game time: 27m 23s elapsed, 5h 32m 37s of budget remaining.
  71. 27m 23sbuy_upgrade upgrades=["trees"] · evidence
    result
    Bought trees, now level 3. Paid hay 1200. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 27m 33s elapsed, 5h 32m 27s of budget remaining.
  72. 27m 33swait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: carrot +1196, fertilizer +60, hay +1756, wood +10524.
    Game time: 32m 43s elapsed, 5h 27m 17s of budget remaining.
  73. 32m 43sbuy_upgrade upgrades=["speed","lists","carrots","watering","debug","import"] · evidence
    result
    Bought speed, now level 4. Paid carrot 500. Its tutorial is docs page docs/unlocks/speed.md.
    Bought lists, now level 1. Paid carrot 500. Its tutorial is docs page docs/scripting/lists.md.
    Bought carrots, now level 4. Paid wood 6250. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought watering, now level 4. Paid wood 3200. Its tutorial is docs page docs/unlocks/watering.md.
    Bought debug, now …
  74. 32m 53sresearch
    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…
  75. 33m 03sbuy_upgrade upgrades=["sunflowers"] · evidence
    result
    Bought sunflowers, now level 1. Paid carrot 500. Its tutorial is docs page docs/unlocks/sunflowers.md.
    Game time: 33m 13s elapsed, 5h 26m 47s of budget remaining.
  76. 33m 13sdocs_read path="unlocks/sunflowers" show_hints=true
    result
    ## Sunflowers
    Sunflowers and Power.
    
    plant(Entities.Sunflowers)
    
    [Tutorial](docs/unlocks/sunflowers.md)
    Game time: 33m 23s elapsed, 5h 26m 37s of budget remaining.
  77. 33m 23sobserve
    result
    Game time: 33m 33s elapsed, 5h 26m 27s of budget remaining.
    Program: main (running).
    Inventory: hay 2104, wood 6102, carrot 659, fertilizer 113.
    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: Ca=carrot, Tr=tree.
    y= 5  #Ca3  _Tr3  #Ca3  _Tr3  #Ca3  _Tr3
    y= 4  _Tr3  …
  78. 33m 33sdocs_read path="docs/unlocks/sunflowers.md" show_hints=true
    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…
  79. 33m 43sdocs_read path="objects/sunflower" show_hints=true
    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: 33m 53s elapsed, 5h 26m 7s…
  80. 33m 53sdocs_read path="docs/scripting/lists.md" show_hints=true
    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…
  81. 34m 03sstop_program
    result
    Program stopped.
    Game time: 34m 13s elapsed, 5h 25m 47s of budget remaining.
  82. 34m 13swrite_program name="main" · evidence
    result
    Saved main (86 lines).
    Game time: 34m 23s elapsed, 5h 25m 37s of budget remaining.
  83. 34m 23srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +161, fertilizer +12, hay +8, power +196.71, pumpkin +216, water -16, wood +500.
    Game time: 35m 33s elapsed, 5h 24m 27s of budget remaining.
    Output:
    (none)
  84. 35m 33swait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: carrot -949, fertilizer +60, hay +2648, power -73.50, pumpkin +4536, water -5, wood +6340.
    Game time: 40m 43s elapsed, 5h 19m 17s of budget remaining.
  85. 40m 43sbuy_upgrade upgrades=["trees","fertilizer","polyculture","expand"] · evidence
    result
    Bought trees, now level 4. Paid hay 4800. Its tutorial is docs page docs/unlocks/trees.md.
    Bought fertilizer, now level 3. Paid wood 9000. Its tutorial is docs page docs/unlocks/fertilizer.md.
    Bought polyculture, now level 1. Paid pumpkin 3000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Bought expand, now level 5. Paid pumpkin 1000. Its tutorial is docs page docs/unlocks/expand_1.md.
    G…
  86. 40m 53sdocs_read path="docs/unlocks/polyculture.md" show_hints=true
    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…
  87. 41m 03sresearch
    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…
  88. 41m 13sstop_program
    result
    Program stopped.
    Game time: 41m 23s elapsed, 5h 18m 37s of budget remaining.
  89. 41m 23swrite_program name="main" · evidence
    result
    Saved main (129 lines).
    Game time: 41m 33s elapsed, 5h 18m 27s of budget remaining.
  90. 41m 33srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot -56, fertilizer +23, hay +1768, power +508.61, water +18, weird_substance +40, wood -8.
    Game time: 42m 43s elapsed, 5h 17m 17s of budget remaining.
    Output:
    (none)
  91. 42m 43sobserve
    result
    Game time: 42m 53s elapsed, 5h 17m 7s of budget remaining.
    Program: main (running).
    Inventory: hay 5448, wood 10170, carrot 400, pumpkin 752, weird_substance 40, water 42, fertilizer 248, power 735.19.
    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=tr…
  92. 42m 53swait seconds=60
    result
    Waited 1m (time up). Program: main running.
    Inventory change: carrot +472, fertilizer +22, hay +10916, power -40.48, water +46, weird_substance +44, wood +1448.
    Game time: 44m 3s elapsed, 5h 15m 57s of budget remaining.
  93. 44m 03swait seconds=60 until_resources={"hay":19200,"wood":12500}
    result
    Waited 0s (hay reached 19964). Program: main running.
    Inventory change: no change.
    Game time: 44m 13s elapsed, 5h 15m 47s of budget remaining.
  94. 44m 13sbuy_upgrade upgrades=["trees","grass"] · evidence
    result
    Bought trees, now level 5. Paid hay 19200. Its tutorial is docs page docs/unlocks/trees.md.
    Bought grass, now level 5. Paid wood 12500.
    Game time: 44m 23s elapsed, 5h 15m 37s of budget remaining.
  95. 44m 23swait seconds=120
    result
    Waited 2m (time up). Program: main running.
    Inventory change: carrot +424, fertilizer +48, hay +15632, power -81.00, water +92, wood +12640.
    Game time: 46m 33s elapsed, 5h 13m 27s of budget remaining.
  96. 46m 33sstop_program
    result
    Program stopped.
    Game time: 46m 43s elapsed, 5h 13m 17s of budget remaining.
  97. 46m 43swrite_program name="main" · evidence
    result
    Saved main (145 lines).
    Game time: 46m 53s elapsed, 5h 13m 7s of budget remaining.
  98. 46m 53srun_program name="main" seconds=120
    result
    Ran main for 2m of game time; it is still running.
    Inventory change: carrot +1015, fertilizer -28, hay +8448, power -80.89, pumpkin +387, water -59, weird_substance +26800, wood +29872.
    Game time: 49m 3s elapsed, 5h 10m 57s of budget remaining.
    Output:
    (none)
  99. 49m 03sbuy_upgrade upgrades=["speed","mazes","carrots","pumpkins"] · evidence
    result
    Bought speed, now level 5. Paid carrot 1000. Its tutorial is docs page docs/unlocks/speed.md.
    Bought mazes, now level 1. Paid weird_substance 1000. Its tutorial is docs page docs/unlocks/mazes.md.
    Bought carrots, now level 5. Paid wood 31200. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought pumpkins, now level 2. Paid carrot 1000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Game t…
  100. 49m 13sdocs_read path="unlocks/mazes" show_hints=true
    result
    ## Mazes
    Increases the gold in treasure chests and the amount of weird substance needed to spawn a maze.
    100% => 200%
    
    ### Unlock Cost [Current cost: cactus=12000]
    
    [Tutorial](docs/unlocks/mazes.md)
    Game time: 49m 23s elapsed, 5h 10m 37s of budget remaining.
  101. 49m 23sresearch
    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 5/10; cost wood 156000; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield an…
  102. 49m 33sdocs_read path="docs/unlocks/mazes.md" show_hints=true
    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…
  103. 49m 43sbuy_upgrade upgrades=["watering"] · evidence
    result
    Bought watering, now level 5. Paid wood 12800. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 49m 53s elapsed, 5h 10m 7s of budget remaining.
  104. 49m 53sobserve
    result
    Game time: 50m 3s elapsed, 5h 9m 57s of budget remaining.
    Program: main (running).
    Inventory: hay 30652, wood 26366, carrot 490, pumpkin 2291, weird_substance 47884, water 150, fertilizer 279, power 441.66.
    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, …
  105. 50m 03sstop_program
    result
    Program stopped.
    Game time: 50m 13s elapsed, 5h 9m 47s of budget remaining.
  106. 50m 13swrite_program name="main" · evidence
    result
    Saved main (161 lines).
    Game time: 50m 23s elapsed, 5h 9m 37s of budget remaining.
  107. 50m 23srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +24, gold +595, power -60.59, water +96, weird_substance -195, wood +400.
    Game time: 51m 33s elapsed, 5h 8m 27s of budget remaining.
    Output:
    (none)
  108. 51m 33sstop_program
    result
    Program stopped.
    Game time: 51m 43s elapsed, 5h 8m 17s of budget remaining.
  109. 51m 43swrite_program name="main" · evidence
    result
    Saved main (165 lines).
    Game time: 51m 53s elapsed, 5h 8m 7s of budget remaining.
  110. 51m 53srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +24, gold +135, power -60.57, water +96, weird_substance -135.
    Game time: 53m 3s elapsed, 5h 6m 57s of budget remaining.
    Output:
    (none)
  111. 53m 03sbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Could not buy megafarm: Not enough resources.
  112. 53m 13sobserve
    result
    Game time: 53m 23s elapsed, 5h 6m 37s of budget remaining.
    Program: main (running).
    Inventory: hay 31020, wood 32814, carrot 682, pumpkin 2291, weird_substance 53409, gold 874, water 470, fertilizer 343, power 279.60.
    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: …
  113. 53m 23sstop_program
    result
    Program stopped.
    Game time: 53m 33s elapsed, 5h 6m 27s of budget remaining.
  114. 53m 33swrite_program name="main" · evidence
    result
    Saved main (169 lines).
    Game time: 53m 43s elapsed, 5h 6m 17s of budget remaining.
  115. 53m 43srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot +208, fertilizer +24, gold +577, hay +144, power +388.41, water +30, weird_substance -80, wood +112.
    Game time: 54m 53s elapsed, 5h 5m 7s of budget remaining.
    Output:
    (none)
  116. 54m 53sbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Could not buy megafarm: Not enough resources.
  117. 55m 03swait seconds=60 until_resources={"gold":2000}
    result
    Waited 4s (gold reached 2049). Program: main running.
    Inventory change: fertilizer +1, gold +64, power -4.08, water +6.
    Game time: 55m 17s elapsed, 5h 4m 43s of budget remaining.
  118. 55m 17sbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Bought megafarm, now level 1. Paid gold 2000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Game time: 55m 27s elapsed, 5h 4m 33s of budget remaining.
  119. 55m 27sdocs_read path="unlocks/megafarm" show_hints=true
    result
    ## Megafarm
    Increase drone count further.
    2 => 4
    
    ### Unlock Cost [Current cost: gold=8000]
    
    [Tutorial](docs/unlocks/megafarm.md)
    Game time: 55m 37s elapsed, 5h 4m 23s of budget remaining.
  120. 55m 37sresearch
    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 5/10; cost wood 156000; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield an…
  121. 55m 47sdocs_read path="docs/unlocks/megafarm.md" show_hints=true
    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…
  122. 55m 57sstop_program
    result
    Program stopped.
    Game time: 56m 7s elapsed, 5h 3m 53s of budget remaining.
  123. 56m 07swrite_program name="main" · evidence
    result
    Saved main (169 lines).
    Game time: 56m 17s elapsed, 5h 3m 43s of budget remaining.
  124. 56m 17srun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +24, gold +1664, hay +112, power -60.57, water +96, weird_substance -216.
    Game time: 57m 27s elapsed, 5h 2m 33s of budget remaining.
    Output:
    (none)
  125. 57m 27sstop_program
    result
    Program stopped.
    Game time: 57m 37s elapsed, 5h 2m 23s of budget remaining.
  126. 57m 37swrite_program name="main" · evidence
    result
    Saved main (208 lines).
    Game time: 57m 47s elapsed, 5h 2m 13s of budget remaining.
  127. 57m 47srun_program name="main" seconds=300
    result
    Ran main for 5m of game time; it is still running.
    Inventory change: carrot +2288, fertilizer +90, gold +5184, hay +49872, power -309.64, water +470, weird_substance +10992, wood +17864.
    Game time: 1h 2m 57s elapsed, 4h 57m 3s of budget remaining.
    Output:
    (none)
  128. 1h 02mbuy_upgrade upgrades=["trees","megafarm","watering"] · evidence
    result
    Bought trees, now level 6. Paid hay 76800. Its tutorial is docs page docs/unlocks/trees.md.
    Bought megafarm, now level 2. Paid gold 8000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Bought watering, now level 6. Paid wood 51200. Its tutorial is docs page docs/unlocks/watering.md.
    Game time: 1h 3m 7s elapsed, 4h 56m 53s of budget remaining.
  129. 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 5/10; cost wood 156000; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield an…
  130. 1h 03mobserve
    result
    Game time: 1h 3m 27s elapsed, 4h 56m 33s of budget remaining.
    Program: main (running).
    Inventory: hay 17516, wood 14694, carrot 3930, pumpkin 2291, weird_substance 77067, gold 49, water 1388, fertilizer 521, power 171.73.
    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.
    Entiti…
  131. 1h 03mstop_program
    result
    Program stopped.
    Game time: 1h 3m 37s elapsed, 4h 56m 23s of budget remaining.
  132. 1h 03mwrite_program name="main" · evidence
    result
    Saved main (224 lines).
    Game time: 1h 3m 47s elapsed, 4h 56m 13s of budget remaining.
  133. 1h 03mrun_program name="main" seconds=180
    result
    Ran main for 3m of game time; it is still running.
    Inventory change: carrot -1298, fertilizer +72, hay +31104, power +328.74, pumpkin +12288, water +99, wood +19136.
    Game time: 1h 6m 57s elapsed, 4h 53m 3s of budget remaining.
    Output:
    Warning: Cannot plant Entities.Carrot on Grounds.Grassland.
    In: poly_step <- ensure_plant
    plant(Entities.Carrot)
         ^^               
    -----------------------------…
  134. 1h 06mbuy_upgrade upgrades=["expand","cactus"] · evidence
    result
    Bought expand, now level 6. Paid pumpkin 8000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Bought cactus, now level 1. Paid pumpkin 5000. Its tutorial is docs page docs/unlocks/cactus.md.
    Game time: 1h 7m 7s elapsed, 4h 52m 53s of budget remaining.
  135. 1h 07mdocs_read path="docs/unlocks/cactus.md" show_hints=true
    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 `…
  136. 1h 07mresearch
    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…
  137. 1h 07mdocs_read path="objects/cactus" show_hints=true
    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 7m 37s elapsed, 4h 52m 23s of budget remaining.
  138. 1h 07mobserve
    result
    Game time: 1h 7m 47s elapsed, 4h 52m 13s of budget remaining.
    Program: main (running).
    Inventory: hay 54092, wood 34214, carrot 3096, pumpkin 1579, weird_substance 77067, gold 49, water 1397, fertilizer 625, power 325.65.
    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.
    Enti…
  139. 1h 07mstop_program
    result
    Program stopped.
    Game time: 1h 7m 57s elapsed, 4h 52m 3s of budget remaining.
  140. 1h 07mwrite_program name="main" · evidence
    result
    Saved main (292 lines).
    Game time: 1h 8m 7s elapsed, 4h 51m 53s of budget remaining.
  141. 1h 08mrun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: carrot -144, fertilizer +24, hay +2304, power +901.76, pumpkin -288, water +54.
    Game time: 1h 9m 17s elapsed, 4h 50m 43s of budget remaining.
    Output:
    (none)
  142. 1h 09mwait seconds=60
    result
    Waited 1m (time up). Program: main running.
    Inventory change: carrot +18, fertilizer -63, hay +18384, power -192.44, pumpkin +3456, water -266, weird_substance +69600, wood +81696.
    Game time: 1h 10m 27s elapsed, 4h 49m 33s of budget remaining.
  143. 1h 10mbuy_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 10m 37s elapsed, 4h 49m 23s of budget remaining.
  144. 1h 10mdocs_read path="unlocks/dinosaurs" show_hints=true
    result
    ## Dinosaurs
    Increases the yield and cost of dinosaurs.
    100% => 200%
    
    ### Unlock Cost [Current cost: cactus=12000]
    
    [Tutorial](docs/unlocks/dinosaurs.md)
    Game time: 1h 10m 47s elapsed, 4h 49m 13s of budget remaining.
  145. 1h 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 5/10; cost wood 156000; available, not affordable; tutorial doc…
  146. 1h 10mdocs_read path="docs/unlocks/dinosaurs.md" show_hints=true
    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 …
  147. 1h 11mbuy_upgrade upgrades=["fertilizer","grass","dictionaries","utilities","timing"] · evidence
    result
    Bought fertilizer, now level 4. Paid wood 54000. Its tutorial is docs page docs/unlocks/fertilizer.md.
    Bought grass, now level 6. Paid wood 62500.
    Bought dictionaries, now level 1. Paid pumpkin 2500. Its tutorial is docs page docs/scripting/dicts.md.
    Bought utilities, now level 1. Paid pumpkin 1000.
    Bought timing, now level 1. Paid pumpkin 1000. Its tutorial is docs page docs/unlocks/timing.md.
    Ga…
  148. 1h 11mobserve
    result
    Game time: 1h 11m 27s elapsed, 4h 48m 33s of budget remaining.
    Program: main (running).
    Inventory: hay 83132, wood 21042, carrot 2810, pumpkin 3415, cactus 27472, weird_substance 168347, gold 49, water 1309, fertilizer 602, power 776.15.
    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); * mar…
  149. 1h 11mdocs_read path="objects/apple" show_hints=true
    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 11m 37s elapsed, 4h 48m 23s of budget remaining.
  150. 1h 11mbuy_upgrade upgrades=["dinosaurs"] · evidence
    result
    Bought dinosaurs, now level 2. Paid cactus 12000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Game time: 1h 11m 47s elapsed, 4h 48m 13s of budget remaining.
  151. 1h 11mresearch
    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…
  152. 1h 11mstop_program
    result
    Program stopped.
    Game time: 1h 12m 7s elapsed, 4h 47m 53s of budget remaining.
  153. 1h 12mwrite_program name="main" · evidence
    result
    Saved main (358 lines).
    Game time: 1h 12m 17s elapsed, 4h 47m 43s of budget remaining.
  154. 1h 12mrun_program name="main" seconds=120
    result
    Ran main for 1m 34s of game time; it stopped with an error: Hats.Green_Hat must be unlocked before this can be used.
    Inventory change: cactus -572, carrot +16, fertilizer +76, power -104.30, pumpkin +898, water +301.
    Game time: 1h 14m 1s elapsed, 4h 45m 59s of budget remaining.
    Output:
    Error: Hats.Green_Hat must be unlocked before this can be used.
    In: farm_dinosaurs
    change_hat(Hats.Green_Hat)
       …
  155. 1h 14mdocs_read path="docs/unlocks/hats.md" show_hints=true
    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 14m 11s elapsed, 4h 45m 49s of budget remaining.
  156. 1h 14mobserve
    result
    Game time: 1h 14m 21s elapsed, 4h 45m 39s of budget remaining.
    Program: none running.
    Inventory: hay 84956, wood 44562, carrot 2702, pumpkin 4313, cactus 14900, weird_substance 191547, gold 49, water 1734, fertilizer 713, power 538.03.
    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…
  157. 1h 14mdocs_search query="change_hat"
    result
    docs/home.md: …t-in Functions [abs](functions/abs) [can_harvest](functions/can_harvest) [can_move](functions/can_move) [change_hat](functions/change_hat) [clear](functions/clear) [dict](functions/dict) [do_a_flip](functions/do_a_flip) [get_companion](functions/get_companion) [get_entity_type](f…
    docs/unlocks/dinosaurs.md: …n do now is dressing up as one. For this purpose you have received the new …
  158. 1h 14mdocs_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…
  159. 1h 14mdocs_read path="docs/home.md" show_hints=true
    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)      [Output](docs/output.md)      [Stats](docs/stats.md)            [Credits](docs/credits.md)
    
    ## Programming
    [Break](docs/scripting/break.md)      [Debug](docs/scripting/debug.md)      [Comments](docs/script…
  160. 1h 14mdocs_read path="functions/change_hat" show_hints=true
    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: 1h 15m 1s elapsed, 4h 44m 59s of budget remaining.
  161. 1h 15mdocs_search query="Hats"
    result
    docs/home.md: …Fertilizer](docs/unlocks/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…
    docs/unlocks/dinosaurs.md: … dressing up as one. For this purpose you have received the new dinosaur ha…
  162. 1h 15mwrite_program name="test_hat" · evidence
    result
    Saved test_hat (1 lines).
    Game time: 1h 15m 21s elapsed, 4h 44m 39s of budget remaining.
  163. 1h 15mrun_program name="test_hat" seconds=5
    result
    Ran test_hat for 0s of game time; it finished.
    Inventory change: bone +40898.
    Game time: 1h 15m 31s elapsed, 4h 44m 29s of budget remaining.
    Output:
    (none)
  164. 1h 15mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Bought polyculture, now level 2. Paid bone 10000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game time: 1h 15m 41s elapsed, 4h 44m 19s of budget remaining.
  165. 1h 15mresearch
    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…
  166. 1h 15mwrite_program name="main" · evidence
    result
    Saved main (363 lines).
    Game time: 1h 16m 1s elapsed, 4h 43m 59s of budget remaining.
  167. 1h 16mrun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +48, gold +3456, power -60.66, water +192, weird_substance -312.
    Game time: 1h 17m 11s elapsed, 4h 42m 49s of budget remaining.
    Output:
    (none)
  168. 1h 17mstop_program
    result
    Program stopped.
    Game time: 1h 17m 21s elapsed, 4h 42m 39s of budget remaining.
  169. 1h 17mwrite_program name="main" · evidence
    result
    Saved main (374 lines).
    Game time: 1h 17m 31s elapsed, 4h 42m 29s of budget remaining.
  170. 1h 17mrun_program name="main" seconds=300
    result
    Ran main for 5m of game time; it is still running.
    Inventory change: cactus -64, carrot -144, fertilizer +240, gold +28224, hay +8224, power +146.29, water +814, weird_substance -2352.
    Game time: 1h 22m 41s elapsed, 4h 37m 19s of budget remaining.
    Output:
    (none)
  171. 1h 22mbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Bought megafarm, now level 3. Paid gold 32000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Game time: 1h 22m 51s elapsed, 4h 37m 9s of budget remaining.
  172. 1h 22mwait seconds=180
    result
    Waited 3m (time up). Program: main running.
    Inventory change: bone +40898, cactus -456, carrot -144, fertilizer +144, gold +14688, hay +4640, power +500.99, water +405, weird_substance -1224.
    Game time: 1h 26m 1s elapsed, 4h 33m 59s of budget remaining.
  173. 1h 26mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Bought polyculture, now level 3. Paid bone 50000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game time: 1h 26m 11s elapsed, 4h 33m 49s of budget remaining.
  174. 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 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…
  175. 1h 26mobserve
    result
    Game time: 1h 26m 31s elapsed, 4h 33m 29s of budget remaining.
    Program: main (running).
    Inventory: hay 97820, wood 44562, carrot 2414, pumpkin 4313, cactus 14328, bone 21796, weird_substance 187347, gold 17873, water 3753, fertilizer 1297, power 984.21.
    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…
  176. 1h 26mstop_program
    result
    Program stopped.
    Game time: 1h 26m 41s elapsed, 4h 33m 19s of budget remaining.
  177. 1h 26mwrite_program name="main" · evidence
    result
    Saved main (380 lines).
    Game time: 1h 26m 51s elapsed, 4h 33m 9s of budget remaining.
  178. 1h 26mrun_program name="main" seconds=300
    result
    Ran main for 13s of game time; it stopped with an error: The operator > cannot be used on the operands None and 0.
    Inventory change: cactus +12, fertilizer +10, hay +2688, power -60.19, pumpkin -216, water +39.
    Game time: 1h 27m 14s elapsed, 4h 32m 46s of budget remaining.
    Output:
    Error: The operator > cannot be used on the operands None and 0.
    In: cc_sort_row
    if measure() > measure(East):
           …
  179. 1h 27mobserve
    result
    Game time: 1h 27m 24s elapsed, 4h 32m 36s of budget remaining.
    Program: none running.
    Inventory: hay 100508, wood 44562, carrot 2414, pumpkin 4097, cactus 14340, bone 21796, weird_substance 187251, gold 19025, water 3920, fertilizer 1339, power 887.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,…
  180. 1h 27mwrite_program name="main" · evidence
    result
    Saved main (384 lines).
    Game time: 1h 27m 34s elapsed, 4h 32m 26s of budget remaining.
  181. 1h 27mrun_program name="main" seconds=300
    result
    Ran main for 5m of game time; it is still running.
    Inventory change: bone +81796, cactus +19576, fertilizer +240, hay +1536, power -421.22, pumpkin -288, water +948.
    Game time: 1h 32m 44s elapsed, 4h 27m 16s of budget remaining.
    Output:
    (none)
  182. 1h 32mobserve
    result
    Game time: 1h 32m 54s elapsed, 4h 27m 6s of budget remaining.
    Program: main (running).
    Inventory: hay 102044, wood 44562, carrot 2414, pumpkin 3809, cactus 33880, bone 103592, weird_substance 187251, gold 19025, water 4964, fertilizer 1603, power 456.17.
    Farm 12x12. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small, 2 mediu…
  183. 1h 32mwait seconds=600 until_resources={"bone":250000}
    result
    Waited 5m 51s (bone reached 267184). Program: main running.
    Inventory change: bone +163592, cactus -2100, carrot -144, fertilizer +281, power +627.61, water +939.
    Game time: 1h 38m 55s elapsed, 4h 21m 5s of budget remaining.
  184. 1h 38mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Bought polyculture, now level 4. Paid bone 250000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game time: 1h 39m 5s elapsed, 4h 20m 55s of budget remaining.
  185. 1h 39mresearch
    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…
  186. 1h 39mstop_program
    result
    Program stopped.
    Game time: 1h 39m 25s elapsed, 4h 20m 35s of budget remaining.
  187. 1h 39mwrite_program name="main" · evidence
    result
    Saved main (379 lines).
    Game time: 1h 39m 35s elapsed, 4h 20m 25s of budget remaining.
  188. 1h 39mrun_program name="main" seconds=180
    result
    Ran main for 3m of game time; it is still running.
    Inventory change: carrot +6624, fertilizer +39, hay +363536, power -655.14, water +524, weird_substance +659360, wood +672976.
    Game time: 1h 42m 45s elapsed, 4h 17m 15s of budget remaining.
    Output:
    (none)
  189. 1h 42mbuy_upgrade upgrades=["trees","grass","carrots","watering","pumpkins"] · evidence
    result
    Bought trees, now level 7. Paid hay 307000. Its tutorial is docs page docs/unlocks/trees.md.
    Bought grass, now level 7. Paid wood 312000.
    Bought carrots, now level 6. Paid wood 156000. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought watering, now level 7. Paid wood 205000. Its tutorial is docs page docs/unlocks/watering.md.
    Bought pumpkins, now level 3. Paid carrot 4000. Its tutorial is …
  190. 1h 42mresearch
    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 6/10; cost wood 781000; available, not affordable; tutorial doc…
  191. 1h 43mwait seconds=180
    result
    Waited 3m (time up). Program: main running.
    Inventory change: fertilizer +144, power -230.35, water +1134.
    Game time: 1h 46m 15s elapsed, 4h 13m 45s of budget remaining.
  192. 1h 46mobserve
    result
    Game time: 1h 46m 25s elapsed, 4h 13m 35s of budget remaining.
    Program: main (running).
    Inventory: hay 162964, wood 44538, carrot 4894, pumpkin 3809, cactus 31720, bone 17184, weird_substance 846491, gold 20465, water 7973, fertilizer 2147.
    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); * …
  193. 1h 46mstop_program
    result
    Program stopped.
    Game time: 1h 46m 35s elapsed, 4h 13m 25s of budget remaining.
  194. 1h 46mwrite_program name="main" · evidence
    result
    Saved main (375 lines).
    Game time: 1h 46m 45s elapsed, 4h 13m 15s of budget remaining.
  195. 1h 46mrun_program name="main" seconds=180
    result
    Ran main for 3m of game time; it is still running.
    Inventory change: bone +32, cactus +82944, carrot +2588, fertilizer +144, hay +17088, power +1280.62, pumpkin +12384, water +400, wood +34176.
    Game time: 1h 49m 55s elapsed, 4h 10m 5s of budget remaining.
    Output:
    (none)
  196. 1h 49mbuy_upgrade upgrades=["dinosaurs"] · evidence
    result
    Bought dinosaurs, now level 3. Paid cactus 72000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Game time: 1h 50m 5s elapsed, 4h 9m 55s of budget remaining.
  197. 1h 50mobserve
    result
    Game time: 1h 50m 15s elapsed, 4h 9m 45s of budget remaining.
    Program: main (running).
    Inventory: hay 180052, wood 78714, carrot 7482, pumpkin 15905, cactus 63400, bone 17216, weird_substance 846491, gold 20465, water 8691, fertilizer 2331, power 1165.79.
    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…
  198. 1h 50mresearch
    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 6/10; cost wood 781000; available, not affordable; tutorial doc…
  199. 1h 50mbuy_upgrade upgrades=["mazes"] · evidence
    result
    Bought mazes, now level 3. Paid cactus 72000. Its tutorial is docs page docs/unlocks/mazes.md.
    Game time: 1h 50m 35s elapsed, 4h 9m 25s of budget remaining.
  200. 1h 50mstop_program
    result
    Program stopped.
    Game time: 1h 50m 45s elapsed, 4h 9m 15s of budget remaining.
  201. 1h 50mwrite_program name="main" · evidence
    result
    Saved main (378 lines).
    Game time: 1h 50m 55s elapsed, 4h 9m 5s of budget remaining.
  202. 1h 50mrun_program name="main" seconds=300
    result
    Ran main for 5m of game time; it is still running.
    Inventory change: cactus +1, carrot -288, fertilizer +240, gold +62208, hay +18240, power +179.61, water +1607, weird_substance -5232.
    Game time: 1h 56m 5s elapsed, 4h 3m 55s of budget remaining.
    Output:
    (none)
  203. 1h 56mwait seconds=300 until_resources={"gold":128000}
    result
    Waited 3m 36s (gold reached 128177). Program: main running.
    Inventory change: carrot -144, fertilizer +172, gold +43200, hay +10048, power -390.51, water +1226, weird_substance -3552.
    Game time: 1h 59m 51s elapsed, 4h 9s of budget remaining.
  204. 1h 59mbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Bought megafarm, now level 4. Paid gold 128000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Game time: 2h 1s elapsed, 3h 59m 59s of budget remaining.
  205. 2h 00mresearch
    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 6/10; cost wood 781000; available, not affordable; tutorial doc…
  206. 2h 00mobserve
    result
    Game time: 2h 21s elapsed, 3h 59m 39s of budget remaining.
    Program: main (running).
    Inventory: hay 217172, wood 78714, carrot 7050, pumpkin 15137, cactus 53609, bone 17216, weird_substance 837227, gold 3057, water 12097, fertilizer 2815, power 529.96.
    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, …
  207. 2h 00mstop_program
    result
    Program stopped.
    Game time: 2h 31s elapsed, 3h 59m 29s of budget remaining.
  208. 2h 00mwrite_program name="main" · evidence
    result
    Saved main (377 lines).
    Game time: 2h 41s elapsed, 3h 59m 19s of budget remaining.
  209. 2h 00mrun_program name="main" seconds=300
    result
    Ran main for 5m of game time; it is still running.
    Inventory change: cactus +414720, carrot +6688, fertilizer +222, hay +1092416, power +491.81, pumpkin +14976, water +920, weird_substance +217760, wood +441568.
    Game time: 2h 5m 51s elapsed, 3h 54m 9s of budget remaining.
    Output:
    Warning: Cannot plant Entities.Carrot on Grounds.Grassland.
    In: poly_batch <- poly_step <- ensure_plant
    plant(Entities.…
  210. 2h 05mbuy_upgrade upgrades=["trees","cactus","dinosaurs"] · evidence
    result
    Bought trees, now level 8. Paid hay 1230000. Its tutorial is docs page docs/unlocks/trees.md.
    Bought cactus, now level 2. Paid pumpkin 20000. 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.
    Game time: 2h 6m 1s elapsed, 3h 53m 59s of budget remaining.
  211. 2h 06mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 2/6; cost pumpkin 120000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 200% => 400%
    carrots (Carrots) level 6/10; cost wood 781000; available, not affordable; tutorial do…
  212. 2h 06mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +414720, carrot +7211, fertilizer +240, hay +1137792, power -629.88, pumpkin +14976, water +1302, wood +446976.
    Game time: 2h 11m 21s elapsed, 3h 48m 39s of budget remaining.
  213. 2h 11mbuy_upgrade upgrades=["pumpkins","mazes"] · evidence
    result
    Could not buy pumpkins: Not enough resources.
    Bought mazes, now level 4. Paid cactus 432000. Its tutorial is docs page docs/unlocks/mazes.md.
    Game time: 2h 11m 31s elapsed, 3h 48m 29s of budget remaining.
  214. 2h 11mwait seconds=180
    result
    Waited 3m (time up). Program: main running.
    Inventory change: fertilizer +144, water +1146.
    Game time: 2h 14m 41s elapsed, 3h 45m 19s of budget remaining.
  215. 2h 14mobserve
    result
    Game time: 2h 14m 51s elapsed, 3h 45m 9s of budget remaining.
    Program: main (running).
    Inventory: hay 1226340, wood 967258, carrot 15917, pumpkin 49281, cactus 19049, bone 17216, weird_substance 1054843, gold 5361, water 15731, fertilizer 3493.
    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)…
  216. 2h 14mbuy_upgrade upgrades=["carrots"] · evidence
    result
    Bought carrots, now level 7. Paid wood 781000. Its tutorial is docs page docs/unlocks/carrots.md.
    Game time: 2h 15m 1s elapsed, 3h 44m 59s of budget remaining.
  217. 2h 15mstop_program
    result
    Program stopped.
    Game time: 2h 15m 11s elapsed, 3h 44m 49s of budget remaining.
  218. 2h 15mwrite_program name="main" · evidence
    result
    Saved main (379 lines).
    Game time: 2h 15m 21s elapsed, 3h 44m 39s of budget remaining.
  219. 2h 15mrun_program name="main" seconds=180
    result
    Ran main for 3m of game time; it is still running.
    Inventory change: cactus +373248, carrot -8124, fertilizer +144, power +447.70, pumpkin +33964, water +346.
    Game time: 2h 18m 31s elapsed, 3h 41m 29s of budget remaining.
    Output:
    (none)
  220. 2h 18mbuy_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: 2h 18m 41s elapsed, 3h 41m 19s of budget remaining.
  221. 2h 18mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 2/6; cost pumpkin 120000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 200% => 400%
    carrots (Carrots) level 7/10; cost wood 3910000; available, not affordable; tutorial d…
  222. 2h 18mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +131072, carrot +12108772, fertilizer -3645, hay +1436544, power +143.27, pumpkin +73728, water +173, weird_substance +11481344, wood +12993920.
    Game time: 2h 24m 1s elapsed, 3h 35m 59s of budget remaining.
  223. 2h 24mbuy_upgrade upgrades=["grass","carrots","watering","watering","pumpkins","pumpkins","pumpkins","pumpkins","pumpkins","pumpkins"] · evidence
    result
    Bought grass, now level 8. Paid wood 1560000.
    Bought carrots, now level 8. Paid wood 3910000. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought watering, now level 8. Paid wood 819000. Its tutorial is docs page docs/unlocks/watering.md.
    Bought watering, now level 9. Paid wood 3280000. Its tutorial is docs page docs/unlocks/watering.md.
    Bought pumpkins, now level 4. Paid carrot 16000. Its t…
  224. 2h 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 2/6; cost pumpkin 120000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 200% => 400%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutorial …
  225. 2h 24mobserve
    result
    Game time: 2h 24m 31s elapsed, 3h 35m 29s of budget remaining.
    Program: main (running).
    Inventory: hay 2872804, wood 4716394, carrot 9014397, pumpkin 91949, cactus 564841, bone 17216, weird_substance 12625787, gold 5361, water 17085, fertilizer 50, power 329.81.
    Farm 16x16. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 small,…
  226. 2h 24mstop_program
    result
    Program stopped.
    Game time: 2h 24m 41s elapsed, 3h 35m 19s of budget remaining.
  227. 2h 24mwrite_program name="main" · evidence
    result
    Saved main (381 lines).
    Game time: 2h 24m 51s elapsed, 3h 35m 9s of budget remaining.
  228. 2h 24mrun_program name="main" seconds=120
    result
    Ran main for 2m of game time; it is still running.
    Inventory change: carrot -695424, fertilizer +96, power -40.74, pumpkin +3342336, water +1565.
    Game time: 2h 27m 1s elapsed, 3h 32m 59s of budget remaining.
    Output:
    (none)
  229. 2h 27mbuy_upgrade upgrades=["cactus","cactus","cactus"] · evidence
    result
    Bought cactus, now level 3. Paid pumpkin 120000. Its tutorial is docs page docs/unlocks/cactus.md.
    Bought cactus, now level 4. Paid pumpkin 720000. Its tutorial is docs page docs/unlocks/cactus.md.
    Could not buy cactus: Not enough resources.
    Game time: 2h 27m 11s elapsed, 3h 32m 49s of budget remaining.
  230. 2h 27mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 4/6; cost pumpkin 4320000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 800% => 1600%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutoria…
  231. 2h 27mwait seconds=180
    result
    Waited 3m (time up). Program: main running.
    Inventory change: cactus +2621440, carrot -374016, fertilizer +144, power -209.50, pumpkin +1941504, water +3809.
    Game time: 2h 30m 31s elapsed, 3h 29m 29s of budget remaining.
  232. 2h 30mbuy_upgrade upgrades=["cactus","dinosaurs"] · evidence
    result
    Bought cactus, now level 5. Paid pumpkin 4320000. Its tutorial is docs page docs/unlocks/cactus.md.
    Bought dinosaurs, now level 5. Paid cactus 2590000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Game time: 2h 30m 41s elapsed, 3h 29m 19s of budget remaining.
  233. 2h 30mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 5/6; cost pumpkin 25900000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 1600% => 3200%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutor…
  234. 2h 30mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +5242368, carrot -777984, fertilizer +240, power -913.41, pumpkin +3891200, water +6411.
    Game time: 2h 36m 1s elapsed, 3h 23m 59s of budget remaining.
  235. 2h 36mwait seconds=60 until_resources={"bone":1000000}
    result
    Waited 1m (time up). Program: main running.
    Inventory change: cactus -832, fertilizer +48, power -60.73, water +1536.
    Game time: 2h 37m 11s elapsed, 3h 22m 49s of budget remaining.
  236. 2h 37mbuy_upgrade upgrades=["mazes"] · evidence
    result
    Bought mazes, now level 5. Paid cactus 2590000. Its tutorial is docs page docs/unlocks/mazes.md.
    Game time: 2h 37m 21s elapsed, 3h 22m 39s of budget remaining.
  237. 2h 37mwait seconds=180 until_resources={"bone":1250000}
    result
    Waited 3m (time up). Program: main running.
    Inventory change: bone +1040400, cactus +2090400, carrot -256, fertilizer +144, power +1190.50, pumpkin -16384, water +4302.
    Game time: 2h 40m 31s elapsed, 3h 19m 29s of budget remaining.
  238. 2h 40mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Could not buy polyculture: Not enough resources.
  239. 2h 40mwait seconds=300 until_resources={"bone":1250000}
    result
    Waited 2m 2s (bone reached 2098016). Program: main running.
    Inventory change: bone +1040400, cactus -7424, fertilizer +98, power -123.30, water +3119.
    Game time: 2h 42m 53s elapsed, 3h 17m 7s of budget remaining.
  240. 2h 42mbuy_upgrade upgrades=["polyculture"] · evidence
    result
    Bought polyculture, now level 5. Paid bone 1250000. Its tutorial is docs page docs/unlocks/polyculture.md.
    Game time: 2h 43m 3s elapsed, 3h 16m 57s of budget remaining.
  241. 2h 43mobserve
    result
    Game time: 2h 43m 13s elapsed, 3h 16m 47s of budget remaining.
    Program: main (running).
    Inventory: hay 3005028, wood 5357674, carrot 6884869, pumpkin 5073645, cactus 6378505, bone 848016, weird_substance 12625019, gold 17649, water 40801, fertilizer 948, power 1416.31.
    Farm 16x16. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1…
  242. 2h 43mwait seconds=600 until_resources={"gold":512000}
    result
    Waited 10m (time up). Program: main running.
    Inventory change: bone +1040400, cactus -8064, carrot -512, fertilizer +480, gold +356352, hay +65792, power +724.58, water +14731, weird_substance -22528.
    Game time: 2h 53m 23s elapsed, 3h 6m 37s of budget remaining.
  243. 2h 53mbuy_upgrade upgrades=["megafarm"] · evidence
    result
    Could not buy megafarm: Not enough resources.
  244. 2h 53mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 5/6; cost pumpkin 25900000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 1600% => 3200%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutor…
  245. 2h 53mwait seconds=300 until_resources={"gold":512000}
    result
    Waited 1m 59s (gold reached 513265). Program: main running.
    Inventory change: fertilizer +95, gold +110592, hay +1152, power -871.81, water +3059, weird_substance -6656.
    Game time: 2h 55m 52s elapsed, 3h 4m 8s of budget remaining.
  246. 2h 55mbuy_upgrade upgrades=["megafarm","expand"] · evidence
    result
    Bought megafarm, now level 5. Paid gold 512000. Its tutorial is docs page docs/unlocks/megafarm.md.
    Bought expand, now level 8. Paid pumpkin 512000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Game time: 2h 56m 2s elapsed, 3h 3m 58s of budget remaining.
  247. 2h 56mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 5/6; cost pumpkin 25900000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 1600% => 3200%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutor…
  248. 2h 56mbuy_upgrade upgrades=["expand","grass","trees"] · evidence
    result
    Bought expand, now level 9. Paid pumpkin 4100000. Its tutorial is docs page docs/unlocks/expand_1.md.
    Bought grass, now level 9. Paid wood 7810000.
    Bought trees, now level 9. Paid hay 4920000. Its tutorial is docs page docs/unlocks/trees.md.
    Game time: 2h 56m 22s elapsed, 3h 3m 38s of budget remaining.
  249. 2h 56mresearch
    result
    auto_unlock (Auto Unlock) level 0/1; cost pumpkin 5000; requires costs
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 5/6; cost pumpkin 25900000; available, not affordable; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 1600% => 3200%
    carrots (Carrots) level 8/10; cost wood 19500000; available, not affordable; tutor…
  250. 2h 56mobserve
    result
    Game time: 2h 56m 42s elapsed, 3h 3m 18s of budget remaining.
    Program: main (running).
    Inventory: hay 1874852, wood 10736730, carrot 6775261, pumpkin 975821, cactus 6370409, bone 1888416, weird_substance 25651003, gold 1265, water 58769, fertilizer 1337, power 242.84.
    Farm 32x32. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (1 …
  251. 2h 56mstop_program
    result
    Program stopped.
    Game time: 2h 56m 52s elapsed, 3h 3m 8s of budget remaining.
  252. 2h 56mwrite_program name="main" · evidence
    result
    Saved main (381 lines).
    Game time: 2h 57m 2s elapsed, 3h 2m 58s of budget remaining.
  253. 2h 57mrun_program name="main" seconds=300
    result
    Ran main for 5m of game time; it is still running.
    Inventory change: carrot -2940928, fertilizer +240, power +3253.59, pumpkin +13369344, water -3609.
    Game time: 3h 2m 12s elapsed, 2h 57m 48s of budget remaining.
    Output:
    (none)
  254. 3h 02mwait seconds=400 until_resources={"pumpkin":25900000}
    result
    Waited 4m (pumpkin reached 26260813). Program: main running.
    Inventory change: carrot -2129408, fertilizer +192, power +2970.91, pumpkin +11010048, water -1497.
    Game time: 3h 6m 22s elapsed, 2h 53m 38s of budget remaining.
  255. 3h 06mbuy_upgrade upgrades=["cactus"] · evidence
    result
    Bought cactus, now level 6. Paid pumpkin 25900000. Its tutorial is docs page docs/unlocks/cactus.md.
    Game time: 3h 6m 32s elapsed, 2h 53m 28s of budget remaining.
  256. 3h 06mobserve
    result
    Game time: 3h 6m 42s elapsed, 2h 53m 18s of budget remaining.
    Program: main (running).
    Inventory: hay 1938596, wood 10736730, carrot 1259013, pumpkin 1147245, cactus 6370409, bone 1888416, weird_substance 25651003, gold 1265, water 53050, fertilizer 1817, power 7414.57.
    Farm 32x32. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size (…
  257. 3h 06mstop_program
    result
    Program stopped.
    Game time: 3h 6m 52s elapsed, 2h 53m 8s of budget remaining.
  258. 3h 06mwrite_program name="main" · evidence
    result
    Saved main (379 lines).
    Game time: 3h 7m 2s elapsed, 2h 52m 58s of budget remaining.
  259. 3h 07mrun_program name="main" seconds=180
    result
    Ran main for 3m of game time; it is still running.
    Inventory change: cactus +33554432, carrot +39536512, fertilizer -1791, hay +33939584, power -4880.95, pumpkin +720896, water +4419, weird_substance +67663104, wood +77240448.
    Game time: 3h 10m 12s elapsed, 2h 49m 48s of budget remaining.
    Output:
    Warning: Cannot plant Entities.Carrot on Grounds.Grassland.
    In: poly_batch <- poly_step <- ensure_plan…
  260. 3h 10mbuy_upgrade upgrades=["dinosaurs","mazes","trees","grass","carrots","pumpkins"] · evidence
    result
    Bought dinosaurs, now level 6. Paid cactus 15600000. Its tutorial is docs page docs/unlocks/dinosaurs.md.
    Bought mazes, now level 6. Paid cactus 15600000. Its tutorial is docs page docs/unlocks/mazes.md.
    Bought trees, now level 10. Paid hay 19700000. Its tutorial is docs page docs/unlocks/trees.md.
    Bought grass, now level 10. Paid wood 39100000.
    Bought carrots, now level 9. Paid wood 19500000. Its…
  261. 3h 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 6/6; maxed; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 3200%
    carrots (Carrots) level 9/10; cost wood 97700000; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots Increases t…
  262. 3h 10mobserve
    result
    Game time: 3h 10m 42s elapsed, 2h 49m 18s of budget remaining.
    Program: main (running).
    Inventory: hay 31078148, wood 78069402, carrot 28666885, pumpkin 1802605, cactus 8724841, bone 1888416, weird_substance 94513467, gold 1265, water 58964, fertilizer 55, power 1638.09.
    Farm 32x32. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + size …
  263. 3h 10mwait seconds=60 until_resources={"carrot":65500000,"wood":97700000}
    result
    Waited 1m (time up). Program: main running.
    Inventory change: fertilizer +48, power -1314.13, water +1536.
    Game time: 3h 11m 52s elapsed, 2h 48m 8s of budget remaining.
  264. 3h 11mbuy_upgrade upgrades=["carrots","pumpkins","costs","auto_unlock","debug_2"] · evidence
    result
    Could not buy carrots: Not enough resources.
    Could not buy pumpkins: Not enough resources.
    Bought costs, now level 1. Paid pumpkin 2500. Its tutorial is docs page docs/unlocks/costs.md.
    Bought auto_unlock, now level 1. Paid pumpkin 5000. Its tutorial is docs page docs/unlocks/auto_unlock.md.
    Bought debug_2, now level 1. Paid gold 500. Its tutorial is docs page docs/unlocks/debug2.md.
    Game time: 3h…
  265. 3h 12mresearch
    result
    auto_unlock (Auto Unlock) level 1/1; maxed; tutorial docs/unlocks/auto_unlock.md
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 6/6; maxed; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 3200%
    carrots (Carrots) level 9/10; cost wood 97700000; available, not affordable; tutorial docs/unlocks/carrots.md
      ## Carrots I…
  266. 3h 12mdocs_read path="docs/unlocks/auto_unlock.md"
    result
    # Auto Unlocks
    To fully automate the game, you can use the `unlock()` function to automatically unlock features.
    For example, you can use `unlock(Unlocks.Speed)` and `unlock(Unlocks.Expand)` to unlock the speed and expansion features.
    
    To determine the cost of an unlock, simply use the `get_cost()` function as you would for a plant or item.
    Example:
    `get_cost(Unlocks.Loops)`
    returns `{Items.Hay:5}…
  267. 3h 12mwait seconds=60 until_resources={"cactus":40000000}
    result
    Waited 0s (cactus reached 42279273). Program: main running.
    Inventory change: no change.
    Game time: 3h 12m 32s elapsed, 2h 47m 28s of budget remaining.
  268. 3h 12mwait seconds=180 until_resources={"wood":97700000}
    result
    Waited 57s (wood reached 97852314). Program: main running.
    Inventory change: carrot +44123520, fertilizer +1, hay +2938624, power -1626.31, water +1393, weird_substance +901248, wood +18598656.
    Game time: 3h 13m 39s elapsed, 2h 46m 21s of budget remaining.
  269. 3h 13mbuy_upgrade upgrades=["carrots","pumpkins"] · evidence
    result
    Bought carrots, now level 10. Paid wood 97700000. Its tutorial is docs page docs/unlocks/carrots.md.
    Bought pumpkins, now level 10. Paid carrot 65500000. Its tutorial is docs page docs/unlocks/pumpkins.md.
    Game time: 3h 13m 49s elapsed, 2h 46m 11s of budget remaining.
  270. 3h 13mresearch
    result
    auto_unlock (Auto Unlock) level 1/1; maxed; tutorial docs/unlocks/auto_unlock.md
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 6/6; maxed; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 3200%
    carrots (Carrots) level 10/10; maxed; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrots.…
  271. 3h 13mstop_program
    result
    Program stopped.
    Game time: 3h 14m 9s elapsed, 2h 45m 51s of budget remaining.
  272. 3h 14mwrite_program name="main" · evidence
    result
    Saved main (391 lines).
    Game time: 3h 14m 19s elapsed, 2h 45m 41s of budget remaining.
  273. 3h 14mrun_program name="main" seconds=600
    result
    Ran main for 10m of game time; it is still running.
    Inventory change: cactus -2624, carrot +2071040, fertilizer +480, hay +1155072, power -685.45, water +15360, wood +19878400.
    Game time: 3h 24m 29s elapsed, 2h 35m 31s of budget remaining.
    Output:
    (none)
  274. 3h 24mwait seconds=300 until_resources={"bone":100000000}
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus -5376, fertilizer +240, power -303.74, water +7680.
    Game time: 3h 29m 39s elapsed, 2h 30m 21s of budget remaining.
  275. 3h 29mbuy_upgrade upgrades=["the_farmers_remains"] · evidence
    result
    Could not buy the_farmers_remains: Not enough resources.
  276. 3h 29mresearch
    result
    auto_unlock (Auto Unlock) level 1/1; maxed; tutorial docs/unlocks/auto_unlock.md
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 6/6; maxed; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 3200%
    carrots (Carrots) level 10/10; maxed; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrots.…
  277. 3h 29mwait seconds=1800 until_resources={"bone":100000000}
    result
    Waited 30m (time up). Program: main running.
    Inventory change: bone +33488928, cactus -67200, carrot -1024, fertilizer +1440, power +5683.48, water +44888.
    Game time: 4h 9s elapsed, 1h 59m 51s of budget remaining.
  278. 4h 00mbuy_upgrade upgrades=["the_farmers_remains"] · evidence
    result
    Could not buy the_farmers_remains: Not enough resources.
  279. 4h 00mresearch
    result
    auto_unlock (Auto Unlock) level 1/1; maxed; tutorial docs/unlocks/auto_unlock.md
      ## Auto Unlock Automatically unlock things. unlock(Unlocks.Megafarm)
    cactus (Cactus) level 6/6; maxed; tutorial docs/unlocks/cactus.md
      ## Cactus Increases the yield and cost of cactus. 3200%
    carrots (Carrots) level 10/10; maxed; tutorial docs/unlocks/carrots.md
      ## Carrots Increases the yield and cost of carrots.…
  280. 4h 00mwait seconds=900 until_resources={"bone":68000000}
    result
    Waited 12m 36s (bone reached 68866272). Program: main running.
    Inventory change: bone +33488928, cactus -53376, fertilizer +605, power -765.65, water +19357.
    Game time: 4h 13m 15s elapsed, 1h 46m 45s of budget remaining.
  281. 4h 13mstop_program
    result
    Program stopped.
    Game time: 4h 13m 25s elapsed, 1h 46m 35s of budget remaining.
  282. 4h 13mwrite_program name="main" · evidence
    result
    Saved main (335 lines).
    Game time: 4h 13m 35s elapsed, 1h 46m 25s of budget remaining.
  283. 4h 13mrun_program name="main" seconds=600
    result
    Ran main for 10m of game time; it is still running.
    Inventory change: bone +128, carrot -1024, fertilizer +480, gold +1081344, hay +535552, power -4778.63, water +14255, weird_substance -33792.
    Game time: 4h 23m 45s elapsed, 1h 36m 15s of budget remaining.
    Output:
    (none)
  284. 4h 23mbuy_upgrade upgrades=["simulation","leaderboard"] · evidence
    result
    Bought simulation, now level 1. Paid gold 5000. Its tutorial is docs page docs/unlocks/simulation.md.
    Bought leaderboard, now level 1. Paid bone 2000000, gold 1000000. Its tutorial is docs page docs/unlocks/leaderboard.md.
    Game time: 4h 23m 55s elapsed, 1h 36m 5s of budget remaining.
  285. 4h 23mstop_program
    result
    Program stopped.
    Game time: 4h 24m 5s elapsed, 1h 35m 55s of budget remaining.
  286. 4h 24mdocs_read path="docs/unlocks/debug2.md"
    result
    # Debug 2
    When your drone gets too fast and the grid too big it can be hard to see what's going on anymore.
    
    For this reason there are the `set_execution_speed()` and `set_world_size()` functions.
    They allow you to reduce the execution speed and the farm size. 
    
    The farm size and the execution speed will be reset to the default values at the end of the execution.
    Game time: 4h 24m 15s elapsed, 1h …
  287. 4h 24mdocs_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…
  288. 4h 24mwrite_program name="main" · evidence
    result
    Saved main (343 lines).
    Game time: 4h 24m 35s elapsed, 1h 35m 25s of budget remaining.
  289. 4h 24mrun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +48, hay +512, power -62.74, water +1536, weird_substance -160.
    Game time: 4h 25m 45s elapsed, 1h 34m 15s of budget remaining.
    Output:
    (none)
  290. 4h 25mobserve
    result
    Game time: 4h 25m 55s elapsed, 1h 34m 5s of budget remaining.
    Program: main (running).
    Inventory: hay 40192260, wood 98114554, carrot 39906853, pumpkin 1795105, cactus 42148137, bone 66866400, weird_substance 100274971, gold 77109, water 170965, fertilizer 3488, power 3290.72.
    Farm 5x5. x runs west to east, rows are listed north (top) to south.
    Cells: ground (# soil, _ grassland) + entity code + s…
  291. 4h 25mstop_program
    result
    Program stopped.
    Game time: 4h 26m 5s elapsed, 1h 33m 55s of budget remaining.
  292. 4h 26mwrite_program name="main" · evidence
    result
    Saved main (346 lines).
    Game time: 4h 26m 15s elapsed, 1h 33m 45s of budget remaining.
  293. 4h 26mrun_program name="main" seconds=60
    result
    Ran main for 1m of game time; it is still running.
    Inventory change: fertilizer +48, gold +1357600, hay +512, power -1504.16, water +1536, weird_substance -271680.
    Game time: 4h 27m 25s elapsed, 1h 32m 35s of budget remaining.
    Output:
    (none)
  294. 4h 27mstop_program
    result
    Program stopped.
    Game time: 4h 27m 35s elapsed, 1h 32m 25s of budget remaining.
  295. 4h 27mwrite_program name="main" · evidence
    result
    Saved main (339 lines).
    Game time: 4h 27m 45s elapsed, 1h 32m 15s of budget remaining.
  296. 4h 27mrun_program name="main" seconds=2400
    result
    Ran main for 7m 23s of game time; it is still running.
    Inventory change: carrot -2048, fertilizer +354, gold +8937600, hay +1041408, power +5258.74, water +9093, weird_substance -1787840.
    Game time: 4h 35m 18s elapsed, 1h 24m 42s of budget remaining.
    Output:
    (none)
  297. 4h 35mwait seconds=60
    result
    Waited 1m (time up). Program: main running.
    Inventory change: fertilizer +48, gold +1396000, power -1518.75, water +1536, weird_substance -279200.
    Game time: 4h 36m 18s elapsed, 1h 23m 42s of budget remaining.
  298. 4h 36mwait seconds=600
    result
    Waited 6m 27s (time up). Program: main running.
    Inventory change: carrot -1024, fertilizer +310, gold +8321600, hay +516608, power -1562.33, water +8798, weird_substance -1664480.
    Game time: 4h 42m 56s elapsed, 1h 17m 4s of budget remaining.
  299. 4h 42mwait seconds=600
    result
    Waited 6m 24s (time up). Program: main running.
    Inventory change: carrot -1024, fertilizer +307, gold +8264000, hay +516608, power -1492.00, water +8719, weird_substance -1652960.
    Game time: 4h 49m 20s elapsed, 1h 10m 40s of budget remaining.
  300. 4h 49mwait seconds=600
    result
    Waited 7m 22s (time up). Program: main running.
    Inventory change: carrot -2048, fertilizer +354, gold +8898400, hay +1033216, power +5295.92, water +9091, weird_substance -1780000.
    Game time: 4h 56m 42s elapsed, 1h 3m 18s of budget remaining.
  301. 4h 56mwait seconds=60
    result
    Waited 1m (time up). Program: main running.
    Inventory change: fertilizer +48, gold +1396800, power -1518.76, water +1536, weird_substance -279360.
    Game time: 4h 57m 42s elapsed, 1h 2m 18s of budget remaining.
  302. 4h 57mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: carrot -1024, fertilizer +240, gold +6294400, hay +516608, power +646.17, water +6561, weird_substance -1259040.
    Game time: 5h 2m 52s elapsed, 57m 8s of budget remaining.
  303. 5h 02mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: carrot -3922944, fertilizer +240, gold +4128800, hay +517120, power +969.46, pumpkin +15728640, water +1474, weird_substance -825760.
    Game time: 5h 8m 2s elapsed, 51m 58s of budget remaining.
  304. 5h 08mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +36098560, fertilizer -858, hay +27632640, power +1122.91, pumpkin +37683200, water -777, weird_substance +42938880, wood +5790208.
    Game time: 5h 13m 12s elapsed, 46m 48s of budget remaining.
  305. 5h 13mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +33548032, fertilizer -774, hay +34016768, power +1160.48, pumpkin +34537472, water -1032, weird_substance +39783168, wood +7095296.
    Game time: 5h 18m 22s elapsed, 41m 38s of budget remaining.
  306. 5h 18mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +31673344, fertilizer -813, hay +31326720, power +1143.41, pumpkin +34537472, water -1030, weird_substance +52320256, wood +25105920.
    Game time: 5h 23m 32s elapsed, 36m 28s of budget remaining.
  307. 5h 23mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +31087360, fertilizer -821, hay +31650816, power -2543.91, pumpkin +34537472, water -938, weird_substance +61451264, wood +33596160.
    Game time: 5h 28m 42s elapsed, 31m 18s of budget remaining.
  308. 5h 28mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +41993728, fertilizer -1167, hay +42145792, power -7055.93, pumpkin +37683200, water -1605, weird_substance +77517824, wood +37657600.
    Game time: 5h 33m 52s elapsed, 26m 8s of budget remaining.
  309. 5h 33mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +34131968, fertilizer -701, hay +34052608, power +1087.56, pumpkin +31391744, water -1141, weird_substance +55222528, wood +40203520.
    Game time: 5h 39m 2s elapsed, 20m 58s of budget remaining.
  310. 5h 39mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +28141824, fertilizer +19, hay +29631488, power +1234.23, pumpkin +34554752, water -1190, weird_substance +9422592, wood +31413248.
    Game time: 5h 44m 12s elapsed, 15m 48s of budget remaining.
  311. 5h 44mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +28463360, fertilizer +21, hay +30277120, power +1238.97, pumpkin +34537472, water -1277, weird_substance +8766720, wood +29122560.
    Game time: 5h 49m 22s elapsed, 10m 38s of budget remaining.
  312. 5h 49mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +47127808, fertilizer -65, hay +44581888, power +1215.23, pumpkin +34537472, water -1467, weird_substance +12207872, wood +44261888.
    Game time: 5h 54m 32s elapsed, 5m 28s of budget remaining.
  313. 5h 54mwait seconds=300
    result
    Waited 5m (time up). Program: main running.
    Inventory change: cactus +33554432, carrot +29534464, fertilizer +26, hay +29949440, power +922.19, pumpkin +31391744, water -701, weird_substance +8888576, wood +25512448.
    Game time: 5h 59m 42s elapsed, 18s of budget remaining.
  314. 5h 59mwait seconds=8
    result
    Waited 8s (time up). Program: main running.
    Inventory change: fertilizer +6, power -248.83, water +205.
    Game time: 6h elapsed, 0s of budget remaining. The game-time budget is used up. The run is over; stop now.
  315. 6h 00msaidThe 6-hour game-time budget is complete. Here is a summary of our farm economy and automation: ### 1. Upgrades & Farm Progression - Grid Expansion: Maxed `expand` (9/9) for a `32x32` farm (`1,024` tiles). - Multi-Drone Fleet: Maxed `megafarm` (5/5) for 32 concurrent drones, along with maxed `speed` (5/5), `watering` (9/9), `fertilizer` (4/4), and `polyculture` (5/5, `16000%` multiplier). - Crop & Resource Multipliers: Maxed every production upgrade in the game: - `grass` (10/10 — `51200%`) - `trees` (10/10 — `51200%`) - `carrots` (10/10 — `51200%`) - `pumpkins` (10/10 — `51200%`) - `cactus` (6/6 — `3200%`) - `dinosaurs` (6/6 — `3200%`) - `mazes` (6/6 — `3200%`) - `sunflowers` (1/1), `costs` (1/1), `auto_unlock` (1/1), `debug_2` (1/1), `simulation` (1/1), `leaderboard` (1/1). ### 2. Multi-Drone Automation Architecture (`main`) - 32-Drone Parallel Polyculture + Fertilizer: 32 drones operated in parallel across the `32x32` grid, dynamically selecting the lowest-stock base crop (`Grass`, `Tree`, or `Carrot`), planting its companion, and applying `Items.Fertilizer` to simultaneously accelerate harvests and generate hundreds of millions of `Items.Weird_Substance`. - 32-Drone Parallel Mega-Pumpkins & Sorted Cacti: Assigned 1 drone per column/row across all 32 columns and rows to plant, repair, and harvest full `32x32` mega-pumpkins (`~34.5M` pumpkins per harvest) and parallel odd-even/bubble-sorted `32x32` cactus fields (`33.55M` cacti per harvest). - 32-Drone Parallel Sunflowers: Planted all 32 columns simultaneously and harvested petals in descending order (`15` down to `7`) for maximum `Items.Power` bonus. - 25-Drone `5x5` Instant Maze Gold Farming: Used `set_world_size(5)` with 25 drones stationed on every tile of the `5x5` maze to immediately relocate and harvest treasure chests up to the 300-relocation cap without movement overhead, generating `~1.4M` gold per minute. - Full-Grid Hamiltonian Dinosaur Cycle: Used a Hamiltonian cycle over the `32x32` grid with `Hats.Dinosaur_Hat` to grow `1,023`-length dinosaur tails worth `33.48M` bones per harvest. ### 3. Final Inventory (at 6h 00m 00s) - Weird Substance: ~`449,000,000+` - Cactus: ~`377,700,000+` - Wood: ~`377,800,000+` - Carrot: ~`377,700,000+` - Hay: ~`376,500,000+` - Pumpkin: ~`362,900,000+` - Bone: ~`66,866,400` - Gold: ~`50,000,000+` - Water: ~`165,000+` - Power: ~`3,000+` - Fertilizer: ~`200+`

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)usage.jsonl (one point per prompt turn)

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

Tokens

Input (uncached)385,415
Cache reads8,309,774
Cache writes0
Output269,967
Thinking (subset of output where reported)not reported
Total8,965,156
ModelTokensEstimate
gemini-4-argon8,965,156$4.30

Estimate: API-equivalent estimate at list prices; not an actual charge. Price table prices-2026-10-20.

conditionsprovenance

Limitations

  • Recorded from a harness checkout with uncommitted changes.
  • No agent session log: the token curve has one point per prompt turn.
Run ideconomy-v1-cursor-gemini-4-argon-s2-a1-20261019T183936Z
Taskeconomy-v1 · acb5fb455a43
Budget6h 00m game time · 10s per action · caps: 2,000 tool calls, 20 continuations, 4h 00m real time
Agentundefined 2026.10.16-e3cb207 (cursor-agent)
Applied config{"model":"gemini-4-argon[reasoning_effort=medium]"}
Models reportedgemini-4-argon
Tools availablenot recorded
Harness82d1ceb5eaa9 (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, cursor-agent 2026.10.16-e3cb207
Rubrics
economy-v1 (headline) · Σ over resources of log10(1 + produced) · 51746c5bec27
economy-weighted-v1 · scores 9.37 · log10(1 + Σ w_r × produced_r), weights from late-game sink prices · 228b39065cbd
Started / ended2026-10-19T18:39:36.152Z → 2026-10-19T19:12:40.891Z
Evidence103 items in evidence.json