wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

P5 Editor

Total questions: 20

Worksheet time: 11mins

Name
Class
Date
1.

What is p5.js ?

a)

It is a header file

b)

It is programming language

c)

It is a Javascript library

d)

It is an online compiler

2.

Which function in p5 is executed only once?

a)

draw()

b)

rect()

c)

setup()

d)

createCapture()

3.

What function do we use to create circle?

a)

ellipse()

b)

line()

c)

arc()

d)

circle()

4.

What is a correct code to create a rectangle in p5.js?

a)

rect();

b)

rectangle(20,20,40,50);

c)

rect(40,120,120,40);

d)

rect(40,120);

5.

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

a)

color();

b)

fill();

c)

paint();

d)

noFill();

6.

Which are correct ways to add color to a shape in p5.js?

a)

fill(‘yellow’);

b)

fill(amarillo);

c)

fill(255,255,0);

d)

fill(‘#ebe12d’);

7.

Which code sets the canvas' color to "pink" in p5.js?

a)

background-color('pink');

b)

bg('pink');

c)

background('pink');

d)

bg-color('pink');

8.

______________ are lines of code that perform specific tasks.

a)

Variables

b)

Functions

c)

Loops

d)

Conditionals

9.

__________________ 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)

Variables

b)

Function

c)

Arrays

d)

Parameters

10.

What, 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 runs once and function draw is a loop.

d)

Function setup and function draw are both loops but they allow the programmer to do different things.

11.

How many parameters are there in the code for drawing a line in p5.js?

a)

4

b)

2

c)

3

d)

5

12.

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

13.

RGB, colors range from ___ to ___.

a)

0 - 100

b)

0 - 255

c)

0 - 250

d)

50 - 550

14.

The area where all drawn graphics are displayed is known as the...

a)

console

b)

drawing area

c)

canvas

d)

pallete

15.

Which of the following is an example of a built in variable in P5.js?

a)

background

b)

width

c)

varX

d)

mouse

16.

What is the y coordinate of the following ellipse?

ellipse(70, 120, 150, 180);

a)

70

b)

120

c)

150

d)

180

17.

What are the parameters in the 'createCanvas' function?

a)

No parameters

b)

x and y coordinates

c)

color of the canvas

d)

width and height

18.

You can use the 'random' function to randomly select the values for any function that uses numeric parameters.

a)

True

b)

False

19.

When using 'RGB' to fill the color of a shape, the 4th parameter 'a' controls the __________ of the color.

a)

stroke

b)

weight

c)

transparency

d)

size

20.

Name the different ml5 libraries used by you in the projects made in class.

4 lines