PATCH always acts on the tile it is hovering over. Every command is a function call — name, parentheses, and sometimes one argument in quotes.
drone.move("north" | "south" | "east" | "west")
Flies PATCH one tile in a compass direction. The farm has edges — route around them.
drone.move("east")
drone.move("east")
drone.water()
▶ run this in the playgroundcommon slip: passing "up" or "left" — PATCH only knows "north", "south", "east" and "west", in quotes.
drone.water()
Soaks the crop on the tile PATCH is hovering over, topping up its moisture.
moisture = drone.scan_moisture()
if moisture < 30:
drone.water()
common slip: watering bare soil — "there's no crop here to water. Move PATCH onto a crop first."
drone.scan_moisture()
returns int (0..100)Reads the moisture of the crop under PATCH. Empty soil reads 0.
moisture = drone.scan_moisture()
dry = moisture < 30
common slip: leaving off the parentheses — drone.scan_moisture is a command, so call it: drone.scan_moisture().
drone.scan_crop()
returns strNames the crop under PATCH — like "tomato" — or "none" over empty soil.
crop = drone.scan_crop()
if crop == "tomato":
drone.water()
drone.scan_ready()
returns boolTrue only when a crop is here and ripe enough to pick — the safety check before every harvest.
ready = drone.scan_ready()
if ready:
drone.harvest()
drone.scan_battery()
returns int (0..100)Reads PATCH's battery level, seeded per mission. Low power means it's time to head home.
battery = drone.scan_battery()
if battery < 20:
drone.return_base()
drone.harvest()
Picks the ripe crop under PATCH and clears the tile for replanting.
ready = drone.scan_ready()
if ready:
drone.harvest()
common slip: picking green — "this crop isn't ready to harvest yet. Check drone.scan_ready() before harvesting."
drone.plant("tomato")
Plants a seed on the empty soil under PATCH. The argument is the crop's name, in quotes.
drone.move("south")
drone.plant("tomato")
▶ run this in the playgroundcommon slip: planting on a full tile — "there's already a crop here. Find empty soil to plant on."
drone.skip()
Deliberately leaves this crop alone. Mission goals notice restraint — skipping a healthy crop counts.
moisture = drone.scan_moisture()
if moisture < 30:
drone.water()
else:
drone.skip()
drone.return_base()
Flies PATCH straight home to its charging pad from anywhere on the farm.
battery = drone.scan_battery()
if battery < 20:
drone.return_base()