What is a function that runs once when a p5.js sketch starts?
Function setup()
What command creates a drawing area that is 400 pixels wide and 300 pixels tall?
createCanvas(400, 300)
Which keyword is used to create a variable in JavaScript?
Let
What statement allows a program to make decisions?
An if statement
What tool helps programmers find errors in p5.js?
The Console
What is a function that runs continuously in a loop?
Function draw()
What are the coordinates of the top-left corner of the canvas?
(0,0)
What variable stores the mouse's x-position?
mouseX
What symbol checks if two values are equal?
==
What does console.log() do?
Prints messages to the console.
What is a function that runs when the mouse is clicked?
Function mousePressed()
Which function draws a rectangle?
rect()
What variable stores the mouse's y-position?
mouseY
What does a loop do?
Repeats code
What might happen if there is a syntax error in your code?
The program may not run.
Which is a function that changes the background color of the canvas?
Function background()
What shape does ellipse(50, 50, 40, 40) create?
An oval
What type of data can only be true or false?
Boolean
What happens when an if statement's condition is true?
The code inside the if statement runs.
What does cloudX += 0.5; typically control in an animation?
Movement of an object.
Which is a function that displays words on the canvas?
Function text()
Which function removes the outline around shapes?
noStroke()
What function generates a random number between two values?
random()
Give an example of when you might use a loop in animation.
To continuously move an object across the screen.
Why are comments and indentation important?
They make code easier to read and understand.