What you learn today
- Plant and Harvest
- Resupply seeds
- Harvest cycle
Reporting ripeness is nice, but you still have to harvest yourself. The Harvie does that for you: it hangs above a hydroponics tray, plants from its import slot and puts the harvest into its export slot. It gets its commands from the chip over the data network.
The Harvie
| LogicType | Direction | means |
|---|---|---|
Plant | write | plants the next seed from the import slot |
Harvest | write | harvests the plant below |
Activate | read | 0 = arm free, 1 = planting, 2 = harvesting |
Mode | read | face: 0 no plant, 1 happy, 2 unhappy, 3 dead |
On | read and write | without power and On it does nothing |
Slots: 0 is the import (seeds or plants), 1 the export (the harvest), 2 the hand of the arm.
Plant and Harvest are commands, not switches. In the game code any value above 0 triggers the action, a 0 is ignored. So you may write sbn HARVIE HASH("Ernter") Harvest ripe every tick: as long as ripe is 0, nothing happens.
Harvest on an unripe plant does not harvest, it pulls the plant out and destroys it. It is the same action as “Clear” on the Harvie's button. Only write Harvest when the tray reports Mature = 1.
The harvest cycle
The chip decides anew every tick what to do:
- Is the arm busy (
Activatenot 0)? Then do nothing. - Is the plant ripe? Then
Harvest. - Is the tray empty and are there seeds in the import? Then
Plant.
lbn free HARVIE HASH("Ernter") Activate Average
seqz free free # 1 = arm free
lbns ripe TRAY HASH("Beet") 0 Mature Average
seq ripe ripe 1
and ripe ripe free
sbn HARVIE HASH("Ernter") Harvest ripe
Why the check on the arm? Planting and harvesting are arm movements that take a while. A command during that time is usually discarded, but your chip should not have to rely on that.
Resupplying seeds
The Harvie only plants what lies in the import slot. Quantity in slot 0 tells you how much is left. If the slot is empty, the tray stays empty after the harvest – a light should report that. You can refill by hand or through a chute into the Harvie's import.
Perennial plants such as tomatoes or pumpkins keep growing after the harvest. The tray then stays occupied and the Harvie does not need to plant again. The cycle above copes with both kinds.
Diagram
Exercise
Task
Build the harvest cycle for the Harvie “Ernter” above the hydroponics device “Beet”:
- only give commands while the arm is free (
Activate= 0) Harvestwhen the plant is ripe (Mature= 1)Plantwhen the tray is empty (Occupied= 0) and there are seeds in import slot 0- light “Saat” on when the import slot is empty or the Harvie is missing
Write the commands as 0 or 1 – the Harvie ignores a 0.
Hints
Hint 1
seqz free free turns Activate into a 1 for “arm free”. With NaN that gives 0.
Hint 2
Harvest: seq ripe ripe 1, then and ripe ripe free, then sbn … Harvest ripe.
Hint 3
Plant: combine seqz empty empty and sgtz seed seed with and, plus free.
Quiz
5 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed the simulator exercise
- Passed the quiz with at least 60 %
Without an account progress is saved in this browser only.
Report a mistake in this lesson
Please sign in to report. Sign in