COMMANDS
FOR LOOPS
WHILE LOOPS
MARIST FACTS EVERYONE SHOULD KNOW
100

If KAREL starts in the bottom left corner, what are the commands that will get him to here:

What is:

 putBall();

 turnLeft();

 move();

 turnRight();

 move();

 putBall();

 turnLeft();

 move();

 turnRight();

 move();

 putBall();

 turnLeft();

 move();

 turnRight();

 move();

 putBall();

100

When we write a "for" loop, this is what the letters "int" stand for.

for(int i = 0; i < 5; i++)

What is "Integer"?

100

This "while" condition is what we write if we want Karel to keep moving until he bumps his nose on a wall.

What is while(FrontIsClear())?

100

This is the number of state Football championships Marist has won.

What is three?  1989, 2003, 2020

200

This is the number of "built in" commands that we discussed.


What is 6?

200

For Karel to make a Tower of five balls, what is the "for loop" code that you would need to write? (assume he is starting at the base of the Tower where there is no ball and will end at the top of the Tower sitting on the top facing right).

What is:

200

This is the "while" condition that we will write to get Karel to do something (like "takeBall") as long as there are balls in front of him.

what is while(ballsPresent())?

200

What sports team at Marist has won the MOST state championships?

What is Girls Tennis:

300

If Karel is facing right and we want Karel to face left, this is the most efficient way to accomplish that.

What is: 

turnAround();

300

In the following code, this is how many balls Karel will put down:

What is 9?

300

If we need Karel to move across the row in front of him picking up balls - regardless of how many balls there are - we would write this code (hint: 6 lines of code).

What is:

300

This is the year girls were accepted to Marist.

What is 1976?

400









Fix this code so that Karel will put down three balls:




What is (the "B" in putBall needs to capitalized):

400

Fix this code so that Karel will make a row with four balls with a space in between each ball:

Fixed code (the for loop requires semi colons - not commas):

400

If we want Karel to keep moving as long as there are no balls, we would write this "while" loop (hint: 4 lines of code).

What is 

400

This is the number of students currently enrolled at Marist (+ or - 50).

What is 1100?

500

We enter these characters in our code to write comments that Karel cannot "hear" - also called "annotating" our code or "commenting" our code.

What are "//" or "forward slashes"?

500

If Karel needs to "clean" a row that has five consecutive balls in front of him, how many balls will Karel "clean" (pick up) with this code (assume there are no defined methods below the code):

The answer is zero!  There is no command called "pickUpBall" (it is "takeBall").

500

What needs to be done to the code below for Karel to move across the world and put 10 balls in each corner?

The command "crossWorld" is defined in line 10, but then "crossTheWorld" is called in line 29.  Line 29 should be "crossWorld".

500

This priest - head of campus ministry - first joined Marist School as a brother in December 1973.

Who is Father John Ulrich, SM?