I Command You!
What's Your Function?
Loopty Loops and Conditions
Code in the Wild
Mr. Ali Trivia
100

This command makes Karel move forward by one space.

What is "move();"?

100

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"?

100

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?

100

move(); putball(); move(); move(); move(); move(); move();

The reason why this code will not run.

What is a capitalization error of "putBall();"?

100

True or False

Mr. Ali is married

What is TRUE?

200

Karel uses this command to turn left.

What is "turnLeft();"?

200

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"?

200

This type of loop will execute a block of code a specific number of times.

What is a "for loop"?

200

function start() {    move();    move();    move();    move();    move();    move();    move();    move();    move(); }

This is the easiest way to write this function.

What is a for loop?
200

True or False

Mr Ali has at least one child

TRUE

300

When Karel hits a wall, this command will check if it's he's to move forward.

What is "frontIsClear();"?

300

This is the command used to define a new function in Karel.

What is "function name() { ... }"?

300

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"?

300

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()"?

300

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!

400

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?

400

This function is required every single time you want to tell Karel what to do.

What is "function start() {...}"?

400

This is why we use control structures in JavaScript.

What is "to control the flow of the program; how the commands execute"? 

400

function mystery() {    

     while (noBallsPresent()) { 

         move();    

     } 

}

This is what the "mystery" function does.

What is "Karel moves until it is on a ball"?

400

Which ONE of these sports does Mr. Ali engage in?  Softball, Longboarding, or Tennis

What is Longboarding?


500

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?

500

In a function, we would tell Karel to turn left this many times to turn around.

What is 2?

500

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?

500

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"?

500

True or False.

Mr Ali knows how to code

Um duhhhh!