This is how you tell Karel to move one space.
move();
We use this to repeat a code for any given amount of time.
A loop.
This is an example of what?
if(condition){
/* code */
}
If statement.
We use these to teach Karel new commands.
Functions.
What type of animal is Karel?
Dog.
Karel will not be able to follow this command, why?
turnleft();
The l should be a capital L.
We use this type of loop to repeat code a fixed number of times.
For loops.
This is an example of what?
if(condition){
/* code if condition is true */
}else{
/*code to run otherwise*/
}
If/else Statement.
This function starts all of our programming in Karel.
function start(){
}
The edges of Karel's world are known as.
Walls.
This punctuation follows all of our Karel commands before going to the next.
semi-colon.
We use this loop to repeat a code while something else is true.
A while loop.
When we have a mistake in our program is is called what?
A bug.
This code represents what function in Karel:
turnLeft();
turnLeft();
turnLeft();
function turnRight() {
}
This punctuation indicates what?
/* */
A multi line comment.
These are the two commands SuperKarel knows that Karel does not.
turnAround();
turnRight();
What is wrong with this loop?
for(var i = 0, i < 10, i++){
move()
}
Missing a semicolon
for(var i = 0, i < 10, i++){
move();
}
Karel is at the right edge of the world facing North. If this code is run what will happen?
if(frontIsClear()){
move();
}
Karel will move 1 space North.
We call a function this many times in our programs.
As many as needed.
The rows (left to right) in Karels World are known as this.
Streets.
This is the term to define a command that is true or false.
Boolean.
what condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location?
while (_____){
takeBall();
}
ballsPresent()
Say Karel is on a location with one tennis ball. After the following code runs, how many tennis balls will there be at that location?
for (var i = 0; i < 3; i++) {
if (ballsPresent()) {
takeBall();
} else {
putBall();
putBall();
}
}
1
what does the mystery function do?
function mystery(){
while (noBallsPresent()){
move();
}
}
Karel moves until it is on a ball.
The columns in Karel's world are known as this.
Avenues.