Deviopath › Karel

Checkerboard

Hard · Variables

Paint a checkerboard: the bottom-left square gets a ball, and balls alternate with empty squares in every row and every column.

Your code runs in rooms with odd and even widths, and in a room only one column wide.

Hint: a true/false variable that flips every time Karel moves can tell Karel whether to put a ball.

Next: Spiral Inward