Judging the Relevance and worth of ideas part 2.pptx
Variables, random(), casting from intro Processing class
1. From last time…
•
We talked about variables, random(), and casting!
•
Please write a number from 1–5 on your
proposal and turn it in!
! 1 – little/no prior programming experience!
!
5 – extensive prior programming experience
4. Stats
•
38 students took the quiz!
•
91.3% average score!
•
Just about 75% of the class was above average!
•
Read my notes, answer key online
5. Pixel Grid Questions
Pg. 6
•
The first grid row & column is 0!
•
The upper left hand corner is the origin!
•
The width & height are total, not “from center”
6. HSB Color Model
•
Hue, Saturation, Brightness!
•
The “non-default” color mode!
•
HSV is close, but Processing won’t understand
8. Relational Operators
boolean!! true or false!
>
<
>=
<=
==
!=
greater than
less than
greater than OR equal to
less than OR equal to
equality
inequality
10. If / Else
if (boolean expression) {
// do this if it’s true
} else {
// do this if it’s not true
}
11. If, Else If, Else
if (boolean expression A) {
// do this if A is true
} else if (boolean expression B) {
// do this if B is true
} else {
// do this if neither A nor B is true
}
12. == versus =
== ! ! Checks for equality!
x == 3
=! ! ! Assigns a value!
x = 3
14. constrain()
•
Takes three integer or float arguments!
•
Returns an integer or float!
•
constrain(amount, low, high);
•
Great for color or size:!
! float redColor = constrain(290, 0, 255);
! redColor will be equal to 255