Karel Basics
JavaScript Syntax
Functions & Commands
Logic & Conditions
Loops & Repetition
100

This basic command makes Karel move forward one square.


What is move();?

100

This symbol is used at the end of most JavaScript statements.

What is a semicolon (;)?

100

This keyword defines a new function in JavaScript.

What is a function?

100

This JavaScript statement is used to make decisions in code.

What is an if statement?

100

This type of loop is used when you know exactly how many times to repeat actions.

What is a for loop?

200

When Karel faces this direction at the start of a program.



What is East?

200

These symbols {} are used in JavaScript for this purpose.

What are curly braces (used to define code blocks)?

200

This command makes Karel place a tennis ball in its current position.

What is putBall();?

200

This condition checks if Karel's front is clear of walls.

What is frontIsClear()?

200

This loop continues as long as a specific condition remains true.

What is a while loop?

300

This happens when Karel tries to move through a wall.



What is an error?

300

This type of comment is created using /* and */ in JavaScript.

What is a multi-line comment?

300

This command allows Karel to pick up a tennis ball from the current position.

What is takeBall();?

300

This logical operator means "AND" in JavaScript conditions.

  • What is &&?
300

This is the correct syntax for a for loop that repeats 5 times.

What is for (var i = 0; i < 5; i++) { }?

400

This is the result of calling turnLeft() four times.

 What is Karel's face in the same direction as before (makes a complete 360° turn)?

400

This term describes the practice of indenting code inside curly braces.

What is proper code formatting/indentation?

400

This is a function you create yourself rather than using built-in commands.

What is a custom function/user-defined function?

400

This is the correct syntax for an if-else statement in JavaScript.

What is if (condition) { commands } else { other commands }?

400

When using this loop with Karel, you might create an infinite loop if you're not careful.

What is a while loop?

500

This command is not directly available in Karel but can be created using other commands.

 What is turnRight();?

500

This error occurs when your JavaScript code has a syntax mistake.

What is a syntax error?

500

This is the correct way to define a " buildHouse " function containing multiple commands.

What is the function buildHouse() { [commands here] }?

500

This condition would check if Karel is facing East AND there's no wall to the right.

What is if (facingEast() && rightIsClear()) { }?

500

This code would make Karel move forward until it reaches a wall.

What is while (frontIsClear()) { move(); }?