The Foundation
Loop de Loop
Chaos Theory
Coordination & Canvas
The Drafting Table
100

This function runs only once when the program starts.

What is setup()?

100

In the statement for(let i = 0; i < 10; i++), which part tells the loop to stop when i reaches 10?

what is "The condition: i < 10"?

100

random(50) will give you a number between 0 and what?

what is 50?

100

Where is the coordinate (0, 0) located on a p5.js canvas?

what is "the top-left corner"?

100

In rect(10, 20, 50, 80), what do the first two numbers (10, 20) represent?

what is "The X and Y coordinates of the top-left corner"?

200

This function runs in a continuous loop at roughly 60 frames per second.

what is draw()?

200

In a for loop, what does i++ do to the control variable?

what is "Increments it by 1"?

200

What is the range of numbers generated by random(10, 20)?

what is "Any number from 10 up to, but not including, 20"?

200

If your canvas is createCanvas(400, 400), what variable represents the number 400?

what is "width or height"?

200

By default, where is an ellipse() drawn from: its center or its top-left corner?

what is "its center"?

300

This command goes inside setup() to set the width and height of your project.

what is createCanvas(w, h)?

300

How many times will a loop run if the condition is (let i = 0; i <= 5; i++)?

what is "6 times"?

300

True or False: random() always returns a whole integer (like 5) by default.

what is false? {{it returns decimals/floats }}

300

Which coordinate increases as an object moves down the screen: X or Y?

what is Y? 

300

To draw a line(), how many total coordinates (numbers) must you provide inside the parentheses?

what is four? {{(x1, y1, x2, y2) }}

400

If you move the background() command from draw() into setup(), what happens to a moving circle?

what is "It leaves a trail/smear behind it"?

400

What happens if you accidentally create a loop where the condition is always true?

what is "the Infinite Loop"? / what is "The browser crashes"?

400

If you want a random whole number between 1 and 10, what extra function do you need to wrap around the random?

what is floor()? 

400

What variable in p5.js automatically tracks the X-position of your mouse?

what is mouseX?

400

When creating a custom shape with vertex(), what two commands must you use to "sandwich" your vertex points?

what is "beginShape() and endShape()"?

500

What is the default "Frame Rate" of the draw() function?

what is 60 FPS?

500

Write the code for a loop that counts from 0 to 100 by tens.

what is "for(let i = 0; i <= 100; i += 10)"?

500

How do you generate a random color for a shape's fill?

what is fill(random(255), random(255), random(255))?

500

How do you move an object to the exact center of any sized canvas using variables?

what is (width/2, height/2)?

500

If you want a rect() to behave like an ellipse() and be drawn from its center, what command do you need to run first?

 

what is "rectMode(CENTER);"?