Deviopath › Karel

Sweep the Piles

Medium · While Loops

Some squares in the bottom row have a pile of balls. Pick up every single ball and finish at the end of the row.

The starter only takes one ball from each square. A while (ballsPresent()) loop keeps taking until the square is empty.

Next: Just One Each