wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

p5.js Week1 PREtest

Total questions: 14

Worksheet time: 8mins

Name
Class
Date
1.

In this image, createCanvas and background are examples of _____.

a)

Parameters

b)

Variables

c)

Functions

d)

gloopity gloop

2.

Numbers inside of the parentheses following the name of the function, which provide information the function needs, are called ________.

a)

Brackets

b)

Ellipses

c)

Variables

d)

Parameters (or Arguments)

3.
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.
4.

In a p5.js canvas, what are the coordinates of the top left corner?

a)

0,0

b)

100,100

c)

-width, -height

d)

It depends on the size of the canvas

5.
'Background, arc, and ellipse' are all examples of ______________ in p5.js.
a)
functions
b)
custom variables
c)
shapes
d)
parameters
6.

What are some shapes we can create (with a single function) in p5.js?

a)

Rectangle

b)

Circle

c)

Dog

d)

Triangle

7.
How many parameters are there in the code for drawing a line in p5.js?
Hint: line(x1,y1,x2,y2)
a)
5
b)
1
c)
4
d)
2
8.

What is the height of the following oval (aka ellipse)?

ellipse(70, 120, 150, 180);

a)

70

b)

120

c)

150

d)

180

9.

What is the y coordinate of the following rectangle?

rect(70, 120, 150, 180);

a)

70

b)

120

c)

150

d)

180

10.

Which of the following has the correct function, parameters and 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);

11.

What function do we use to add color to the INSIDE of a shape in p5.js?

a)

fill();

b)

color();

c)

colorize();

d)

paint();

12.

What function do we use to add color to the OUTLINE of a shape in p5.js?

a)

fill();

b)

stroke();

c)

outline();

d)

line();

13.

Using RGB, colors range from ___ to ___.

a)

0 - 255

b)

0 - 100

c)

50 - 550

d)

0 - 250

14.
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.