The code inside the draw() function runs continuously from top
to bottom until the program is stopped. The
code in setup() is run once when the program starts.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
lety=100;
// The statements in the setup() function
// execute once when the program begins
functionsetup(){
// createCanvas must be the first statement
createCanvas(720,400);
stroke(255);// Set line drawing color to white
frameRate(30);
}
// The statements in draw() are executed until the
// program is stopped. Each statement is executed in
// sequence and after the last line is read, the first