RowanoteThe Array Garden

Write one APL function, Harvest. Every day it’s given today’s field as ⍵ and gives back 1s and 0s: 1 means harvest that plot, 0 means leave it. Score as much as you can in 100 days.

Today’s field, ⍵

Day0/100
Score0
Wasted0
Personal best–

⍵ is today’s field. Compare it with a stage, like ⍵=Ripe, to get a yes (1) or no (0) for every plot: Harvest harvests the 1s. The stages come in order: Seed, Sprout, Growing, Ripe, Rotten.

Harvest←{ }

Tap names, symbols and keys to build your code (on a tablet, ⌨ brings up the keyboard), or type symbols with a backtick prefix, so `w gives ⍵. Hover a symbol, focus it with the keyboard or press and hold it to see what it does. Dashed outlines preview what Harvest would pick today, without using up a day. Ctrl+Enter or ⌘+Enter moves to the next day. Tab indents; press Esc then Tab to leave the editor.