NEW
Font size
S
M
L
XL
WorksheetsP5.js
Total questions: 21
Worksheet time: 12mins
Name
Class
Date
1.
The area where all drawn graphics are displayed is known as the...
a)
console
b)
canvas
c)
variable
d)
palate
2.
__________________ are the values inside of the parentheses following the name of the function. These values will be different based on the information that the function needs.
a)
Brackets
b)
Ellipses
c)
Variables
d)
Parameters
3.
Which of the following is an example of a built in variable in P5.js?
a)
background
b)
varX
c)
mouseX
d)
rect
4.
What, if anything, is the difference between function setup () and function draw()?
a)
Function setup is a loop and function draw only runs once.
b)
There are no differences.
c)
Function setup and function draw are both loops but they allow the programmer to do different things.
d)
Function setup runs once and function draw is a loop.
5.
'Background, arc, and ellipse' are all examples of ______________ in p5.js.
a)
functions
b)
custom variables
c)
shapes
d)
parameters
6.
How many parameters are there in the code for drawing a line in p5.js?
Hint: line(x1,y1,x2,y2)
Hint: line(x1,y1,x2,y2)
a)
5
b)
1
c)
4
d)
2
7.
mouseX and mouseY are variables that represent...
a)
The location of the mouse on the X and Y axis.
b)
The location of your drawing on the x and y axis.
c)
The size of the canvas.
d)
None of the above.
8.
Which of the following is the correct syntax for drawing a rectangle?
a)
Rect(x,y,width,height);
b)
rect(x,y,width,height);
c)
rect(width, height, x, y)
d)
rect(x1, x2, y1, y2, width, height);
9.
Which of the following is the correct syntax for drawing a triangle?
a)
triangle(x1,y1,x2,y2,x3,y3);
b)
triangle(x1,x2,x3,y1,y2,y3);
c)
tri(x1,y1,x2,y2,x3,y3);
d)
tri(x1,y1,x2,y2,x3,y3, width, height);
10.
What is the height of the following circle?
ellipse(70, 120, 150, 180);
ellipse(70, 120, 150, 180);
a)
70
b)
120
c)
150
d)
180
11.
What is the y coordinate of the following circle?
ellipse(70, 120, 150, 180);
ellipse(70, 120, 150, 180);
a)
70
b)
120
c)
150
d)
180
12.
______________ are lines of code that perform specific tasks.
a)
Parameters
b)
Variables
c)
Functions
d)
fdsgfds
13.
At what points (radians) will the following arc start and end?
arc(100, 100, 90, 90, PI, 2*PI);
arc(100, 100, 90, 90, PI, 2*PI);
a)
Start - 90, End 360
b)
Start - 0, End 270
c)
Start - 180, End 360
d)
Start - 180, End 270
14.
Which option shows accurate code to display this arc?
a)
arc(100, 100, 90, 90, radians(270), radians(90));
b)
arc(100, 100, 90, 90, radians(180), radians(360));
c)
arc(100, 100, 90, 90, PI, PI/2);
d)
arc(100, 100, 90, 90, PI/2, 2*PI);
15.
Using RGB, colors range from ___ to ___.
a)
0 - 255
b)
0 - 100
c)
50 - 550
d)
0 - 250
16.
HSB stands for ...
a)
Height, Saturation, Boldness
b)
Hue, Saturation, Brightness
c)
Height, Sanitation, Brightness
d)
Hue, Statistics, Boldness
17.
What are the parameters in the 'createCanvas' function?
a)
x and y
b)
color
c)
width and height
d)
There are no parameters in this function.
18.
The 3 steps involved in creating a custom variable are...
a)
name, declare, initialize
b)
declare, initialize, use
c)
initialize, declare, use
d)
name, use, declare
19.
Initializing a custom variable means that you are...
a)
setting the variable equal to some value
b)
naming the variable
c)
telling P5 that the variable exists
d)
all of the above
20.
True or false:
You can use the 'random' function to randomly select the values for any function that uses numeric parameters.
You can use the 'random' function to randomly select the values for any function that uses numeric parameters.
a)
True
b)
False
21.
When using 'RGB' to fill the color of a shape, the 4th parameter controls the __________ of the color.
a)
stroke
b)
weight
c)
transparency
d)
size
Reset
