Need a hint?
The pond
Gold outline = square aheadDucks saved0 / 6
Actions0
DirectionEast →
Ready.
Run starts from this board’s original layout. Pause and Step control the action playback. The run ends when every duck is saved.
How to play
The rover faces the arrow. Sensors and save_duck() look one square ahead. Rescue a duck before moving into its square. A wall is the edge of the pond.
Row 1 is at the top; column 1 is at the left. Your code stays with each challenge on this browser. Download a copy to keep or submit your work.
Your program
Action line will appear here.
Tab indents · Shift+Tab unindents · Enter keeps indentation · Ctrl/⌘+Enter runs · Escape stops
Code saves on this browser.
Same challenge, different seeds
Commands & sensors
move_forward() | Move one square ahead. |
turn_left() / turn_right() | Turn 90° without moving. |
is_duck() | True if a duck is ahead. |
detect_wall() | True if the pond edge is ahead. |
save_duck() | Rescue the duck ahead; stay in place. |
ducks_remaining() | Number of ducks still in the pond. |
all_ducks_saved() | True when no ducks remain. |
sleep(0.5) | Pause playback for half a second (0–5). |
Use normal Python variables, if, for, while, and def. No async or await needed.