This appendix defines the structure of the Karel programming language on a single page.

Base Karel commnds:

move();
turnLeft();
putBeeper();
pickBeeper();

Karel program structures:

/*
 * Comments can be included in any part
 * of a program. They start with a slash-star
 * and end with a star-slash.
 */
public class name extends SuperKarel {

   public void run() {
      declarations to repeat
   }

   definitions of private methods
}

Names of the conditions:
frontIsClear()
beepersPresent()
beepersInBag()
leftIsClear()
rightIsClear()
facingNorth()
facingSouth()
facingEast()
facintWest()
frontIsBlocked() noBeepersPresent()
noBeepersInBag()
leftIsBlocked()
rightIsBlocked()
notFacingNorth()
notFacingSouth()
notFacingEast()
notFacingWest()
Conditions:

if(condition){
code run if condition passes
}

if(condition){
code block for "yes"
} else {
code block for "no"
}

Loops:

for(int i = 0; i < count; i++){
declarations to repeat
}

while(condition){
declarations to repeat
}

Method Declaration:

private voidname() {
commands in the body of the method.
}

SuperKarel additional commands:

turnRight();
turnAround();
random(p);
paintCorner(color);