move direction2 ticks
Move one tile on owned land; returns true on success.
move east Every command, question and helper in Sprout, with what it costs and an example.
Actions change the farm. Each one ends the bot's turn and keeps it busy for the ticks shown.
move direction2 ticksMove one tile on owned land; returns true on success.
move east till3 ticksPrepare an empty tile for planting. The barn and buildings cannot be tilled.
till plant crop2 ticksPlant a researched crop on empty, tilled soil.
plant carrot water2 ticksAdd 30 moisture, up to 100.
water harvest3 ticksHarvest produce or ready hive honey; returns the units carried.
harvest deposit1 tickMove carried produce into barn stock. Compost stays carried.
deposit wait ticksn ticksWait at least one tick. Long waits split into 1,000-tick actions.
wait 100 sell item, units1 tickSell barn stock at today’s price (the base price outside market days); use all for the whole stock of an item.
sell carrot, all deliver order2 ticksAt the barn, fulfil a contract using stock; returns its coin reward.
deliver orders()[0] build kind4 ticksBuild a researched hive or composter on empty grass, paying its coin price.
build hive clear3 ticksRemove a crop, tilled soil or building. No refund or produce is returned.
clear compost2 ticksAt a composter, convert four carried crop units into one compost.
compost fertilize2 ticksUse one carried compost: add 25 nitrogen and remove 20 fatigue.
fertilize Farm actions spend coins. They happen instantly, cost no ticks and don't end the bot's turn.
buy_plot px, pyBuy an edge-adjacent 8×8 plot; returns true on success.
buy_plot 1, 0 buy_botBuy a new bot at the barn. Returns its zero-based id, or none.
buy_bot unlock namePay the research price for a crop, building or satchel.
unlock wheat Questions look at the farm without changing it. They are free.
scan()Inspect the tile below this bot; includes ripe, empty, crop, soil and building.
| Field | Meaning |
|---|---|
x, y | Where the tile is. |
tilled | true if the soil is tilled. |
crop | The crop name, or none. |
stage | 0 to 3. The crop is ripe at 3. |
ripe | true when there is a ripe crop. |
empty | true when there is no crop, no building, and it isn't the barn: ready to till and plant. |
moisture, nitrogen, fatigue | Soil numbers from 0 to 100. |
barn | true on the barn. |
building | hive, composter or none. |
honey | Jars of honey waiting in a hive. |
say scan() scan_at(x, y)Inspect an owned tile, or return none for unowned land.
say scan_at(1, 1) position()Return this bot’s {x, y} position.
say position() my_id()This bot’s zero-based id.
say my_id() load()Return carried units by item name.
say load() carried()Total carried units.
say carried() capacity()The carrying capacity: 20, or 30 with a satchel.
say capacity() tick()Current farm tick.
say tick() owns(x, y)Whether the tile belongs to your farm.
say owns(1, 1) plots()Owned plots in purchase order.
say plots() tiles()Owned tile positions, in plot order then row order.
say tiles() forecast(ticks)Rain and frost segments overlapping the next ticks.
say forecast(500) weather()clear, rain or frost.
say weather() orders()Open contracts with crop, quantity, reward and deadline.
say orders() stock()Barn units by item name.
say stock() coins()Current coin balance.
say coins() plot_cost()Price of the next plot.
say plot_cost() bot_cost()Price of the next bot.
say bot_cost() bots()Number of bots on your farm.
say bots() unlocked(name)Whether the named research is unlocked.
say unlocked(carrot) unlock_cost(name)Price of named research.
say unlock_cost(carrot) price(item)Selling price of an item. On a market day it is today’s price in hundredths of a coin (200 means 2 coins); otherwise the base price in whole coins.
say price(carrot) Helpers for lists, text and numbers, plus printing and walking. All free except go_to, which moves.
go_to position / x, y2 per tile ticksWalk east/west first, then north/south. Every move takes two ticks.
go_to barn say values…Print values to the console, tagged with this bot and tick.
say "Hello from bot", my_id() print values…Print values, like say.
print "hello" len(value)Length of a list, record or string.
say len(tiles()) abs(n)Absolute value.
say abs(-3) min(values…)Smallest value; accepts a list.
say min(2, 5) max(values…)Largest value; accepts a list.
say max(2, 5) range(end / start, end)A list of integers, excluding end.
for each n in range(4):
say n append list, valueAdd a value to the list’s end.
xs = []
append xs, 1 pop(list)Remove and return the last item.
xs = [1, 2]
say pop(xs) insert list, index, valueInsert a value at an index.
xs = [1]
insert xs, 0, 2 remove list, indexRemove the item at an index.
xs = [1, 2]
remove xs, 0 contains(collection, value)Test membership.
say contains([1, 2], 2) keys(record)Return record keys.
say keys({x: 1}) sorted(list)Return a sorted copy of integers or strings.
say sorted([3, 1]) reversed(list)Return a reversed copy.
say reversed([1, 2]) str(value)Convert a value to readable text.
say str(42) int(value)Convert a decimal string to an integer, or none.
say int("42") random(upper)Seeded random integer from zero to upper minus one.
say random(4) distance(a, b)Manhattan distance between tile positions.
say distance(position(), barn) Built-in names you can use anywhere.
north | The name north. |
east | The name east. |
south | The name south. |
west | The name west. |
carrot | The name carrot. |
wheat | The name wheat. |
clover | The name clover. |
pumpkin | The name pumpkin. |
berry | The name berry. |
apple | The name apple. |
honey | The name honey. |
hive | The name hive. |
composter | The name composter. |
satchel | The name satchel. |
barn | The position {x: 0, y: 0}. |
all | The name all. |
shared | One record visible to every bot. Not stored in the farm checkpoint. |
These words are part of the language and can't be used as names. See Learn Sprout for how they're used.
ifelifelsewhilerepeatforevertimesforeachinfromtostepdefinedefreturnbreakcontinuepassstopandornotistruefalsenonesetglobal