Module 08 - Loops Flashcards

1
Q

What is a loop iteration?

A

Refers to a single run of the code inside the loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When you use a loop, such as a ‘for’ loop or a ‘while’ loop, the code inside the loop is repeated multiple times before the condition is met

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is frameCount()?

A

This variable counts the number of frames displayed since the program started

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is frameRate()?

A

Function that controls # of frames per second

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is noLoop()?

A

Function that stops the draw() function from executing continuously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where should noLoop() be placed as an instruction?

A

At the end

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is loop()?

A

Function that resumes the execution of the draw() function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Don’t avoid loop in the setup() function

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does H,S,B stand for?

A

Hue, saturation, and brightness

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How many arguments does the map() function require?

A

5

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How does a poorly placed semi-colon lead to an infinite loop?

A

If you place a semi-colon in a location where its not supposed to be, it can lead to a logic error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does a variable update logic error lead to an infinite loop?

A

You’re facing a problem in how you’re changing the variable of a code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does an infinite loop due to float precision occur?

A

If you compare a floating point number using equality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the map() function?

A

When arguments 2 and 3 are in between the first argument and arguments 4 and 5 determine the last variable.

e.g. - map(200, 100, 300, 0, 50); = (25)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly