import stanford.karel.*;
public class CheckerboardKarel extends SuperKarel {
public void run(){
putBeeper();
seedRight();
}
private void seedRight(){
gotoWall();
turnLeft();
if (frontIsClear()){
jummpNextLine();
turnLeft();
seedLeft();
}
}
private void seedLeft(){
gotoWall();
turnRight();
if (frontIsClear()){
jummpNextLine();
turnRight();
seedRight();
}
}
private void jummpNextLine(){
if (beepersPresent()){
move();
}
else {
move();
putBeeper();
}
}
private void gotoWall(){
while (frontIsClear()){
if (beepersPresent()){
move();
}
else {
move();
putBeeper();
}
}
}
}