CheckerBoard Karel

AB
2 min readSep 11, 2015

--

This program creates a checkerboard using karel.

Problem:

In this exercise, your job is to get Karel to create a checkerboard pattern of beepers inside an empty rectangular world (Karel’s final location and the final direction it is facing at end of the run do not matter.)

Solution:

My solution to this. If front is clear karel populates the row. When front is not clear, depending on where is karel facing and which side is clear, it turnsleft and moves up or turns right and moves up. The top most row is a special case if karel is facing east.

--

--