Professional Documents
Culture Documents
PROCESSING
M4. Variabel pada Processing
Chapters of This Lesson
Chapter 4 :
Variables
Chapters of This Lesson
Chapter 4 :
Variables
Chapters of Variables
1. In this chapter :
Variables: What are they?
Declaring and initializing variables
Common uses for variables
Variables you get “for free” in Processing (AKA “bulit-
in” variables)
Using random values for variables
4.1 What is a Variable?
The concept of a variable in an intuitive manner. On
any given day, Might say “A Variable is like a
bucket”.
You put something in the bucket, carry it around with
you, and retrieve it whenever you feel inspired.
4.1 What is a Variable?
The computer has memory. Why do we call it
memory?
Whole Decimal
Characters
Numbers Numbers
Example :
4.2 Variable Declaration and Initialization
Don’t Forget
What’s in a name?
Exercise 4 – 2:
Result :
4.2 Variable Declaration and Initialization
The Program :
4.3 Using a Variable
Example :
4.3 Using a Variable
Exercise 4-3:
4.3 Using a Variable
Exercise 4-4 :
Exercise 4-4 :
4.5 Many Variable
Example 4-7
4.6 Random: Variety is the spice of life
Example 4-7
4.6 Random: Variety is the spice of life
Example 4-7
4.7 Variable Zoog