Karel Commands
Functions & Loops
Conditionals
Karel’s World
Debugging & Logic
100

Which command makes Karel move forward one space?

move();

100

What keyword defines a new function?

function

100

What keyword checks if a condition is true?

if

100

Where does Karel start in the default world?

Row 1, Column 1, facing East.

100

What is the purpose of comments in code?

To explain what the code does for human readers.

200

What command does Karel use to place a tennis ball?

putBall();

200

Which loop repeats a fixed number of times?

for loop

200

What condition checks if there are balls on the current tile?

ballsPresent()

200

What happens if Karel tries to move into a wall?

Karel crashes — program ends in error.

200

What happens if you call a function that doesn’t exist?

The program gives an error (“undefined function”).

300

What is wrong with this command: turnleft();

The “l” should be capitalized — correct command is turnLeft();

300

What does this code do?

for (let i = 0; i < 3; i++) {
  move();
}

Move forward 3 times

300

What is the opposite of frontIsClear()?

frontIsBlocked()

300

In SuperKarel, what extra commands are available?

turnRight() and turnAround()

300

Why do we indent code?  

To show structure and improve readability.

400

Write the correct syntax for defining a new function called turnRight.

function turnRight() {

  turnLeft();

  turnLeft();

  turnLeft();

}

400

What is “top-down design”?

Breaking a big problem into smaller, easier parts.

400

What happens when the condition in an if is false?

The else part runs (if there is one).

400

If Karel moves twice, turns left, moves once, and turns right — where is she?

One row up and two columns over (Row 2, Col 3 if starting at 1,1 East).

400

What’s the best first step when debugging?

Add comments or print/log statements to trace behavior.

500

Why do programmers use semicolons after commands in Karel?

They mark the end of a statement in JavaScript syntax.

500

What’s wrong with this loop?
for (let i = 0, i < 10, i + 1) {  move(); }


Uses commas instead of semicolons and should use i++.

500

What does this code do?

while (noBallsPresent()) {  move(); }


Moves forward until Karel is standing on a tennis ball.

500

What does a precondition describe in comments?

The state of the world before the code runs.

500

Why use functions like main() and helper functions instead of one long code block?

To organize code, make it reusable, and improve clarity.