Karel Programming
JavaScript Basics
Canvas and Graphics
Control Structures
Bonus Questions
100

What command makes Karel move forward one space?

move();

100

What symbol do you use to do division in JavaScript?

What is.. /

100

Where is the anchor point of a circle?

What is the center.

100

What does it mean for a statement to be true?

A statement is true if it corresponds to reality or a defined set of rules.

100

What are the vertical pathways called in a Karel world?

What are columns.

200

How many times should Karel turn Left to turn Right?

3

200

What is the proper function to call to print to the screen?

What is.. console.log

200

Where is the anchor point of a rectangle?

What is the top left corner.

200

We want to simulate constantly flipping a coin until we get 3 heads in a row. What kind of loop should we use?

While loop

200

Where should all your function definitions go?

Before the start() function or outside it

300

 If karel is facing east and turns left two times where will karel be facing ?

West

300

 What do you mean by Null in JavaScript?


no value or no object

300

How do you set the size of your shape on the canvas?

What is getWidth()/2 ; getHeight()/2

300

What is the proper way to compare if two values are equal in a Boolean expression in JavaScript?

==

300

If the variable a is true, what is the value of !a?

What is false.

400

  When will a while loop stop executing an action?

While a specified condition is true

400

 This is not a true benefit of pair programming, as studies show it doesn’t actually reduce the time it takes to write code by this amount.

Answer:
 What is “Code takes 15% less time to write than with a solo programmer”?

400

How do you link an image to your canvas?

What is Let img = new WebImage (URL);

400

What does the != symbol mean?

Not equals

400

What is the proper way to compare two values that are equal in a boolean expression in JavaScript?

What is ==

500

What are the vertical pathways called in a Karel world?

columns

500

This command is used to generate a random decimal number between 0 and 1, inclusive.

 What is.. Randomizer.nextFloat(0, 1)?

500

What does Debug mode do to your graphic shape and what is the code to debug the object?

  1. It draws a red frame around your shape and bolds the anchor point

  2. (theshape).debug = true:

500

Using your knowledge of comparisons in math, how might we write a variable isGreaterThan for the statement, 5 is greater than 4?

let isGreaterThan = 5 > 4;

500

This loop runs as long as a condition is true, and can run forever if you're not careful. What loop is it?

What is a while loop.