Deviopath › Karel

Fill the Gaps

Medium · Conditions

Some squares in the bottom row already have a ball. Put a ball on every empty square, so each square ends with exactly one ball.

Use if (noBallsPresent()) so Karel only puts a ball where one is missing. Finish at the end of the row.

Next: Flip the Row