This command makes Karel move forward by one space.
What is "move();"?
This is a group of commands that are saved under a single name to teach Karel to do something he doesn't already know.
What is a "function"?
Karel uses this statement to repeat a block of code until a condition is met for no certain amount of time.
What is a while loop?
move(); putball(); move(); move(); move(); move(); move();
The reason why this code will not run.
What is a capitalization error of "putBall();"?
True or False
Mr. Ali is married
What is TRUE?
Karel uses this command to turn left.
What is "turnLeft();"?
The process of breaking a large problem into smaller, more manageable parts is known as this.
What is "decomposition"? or what is "top down design"?
This type of loop will execute a block of code a specific number of times.
What is a "for loop"?
function start() { move(); move(); move(); move(); move(); move(); move(); move(); move(); }
This is the easiest way to write this function.
True or False
Mr Ali has at least one child
TRUE
When Karel hits a wall, this command will check if it's he's to move forward.
What is "frontIsClear();"?
This is the command used to define a new function in Karel.
What is "function name() { ... }"?
This command is used to execute one block of code if a condition is true, and another block if it's false.
What is an "if-else statement"?
while (________) {
takeBall();
}
This condition should be used in this while loop to get Karel to pick up all the tennis balls on the current location
What is "ballsPresent()"?
True or False: Mr Ali once kicked a 1st Degree Black belt in the face
What is FALSE. It was. a 5th degree black belt!
This helps line of code can help show the structure of the code, make it easier for other people to understand, and is a key part of good programming style!
Why does a programmer indent their code?
This function is required every single time you want to tell Karel what to do.
What is "function start() {...}"?
This is why we use control structures in JavaScript.
What is "to control the flow of the program; how the commands execute"?
function mystery() {
while (noBallsPresent()) {
move();
}
}
This is what the "mystery" function does.
What is "Karel moves until it is on a ball"?
Which ONE of these sports does Mr. Ali engage in? Softball, Longboarding, or Tennis
What is Longboarding?
The first option is considered a "street" in Karel's world. The second option is considered an "avenue" in Karel's world.
What is a row and a column?
In a function, we would tell Karel to turn left this many times to turn around.
What is 2?
A program where Karel can pick up a tennis ball if there happens to be one where she is standing.
What is an if statement?
function start() {
while (frontIsClear()) {
// If statement #1
if (ballsPresent()) {
takeBall();
}
move();
}
// If statement #2
if (ballsPresent()) {
takeBall();
}
}
This is the reason for If Statement #2
What is "To pick up the ball that is in the last spot, if there is one"?
True or False.
Mr Ali knows how to code
Um duhhhh!