Skip to content

Commit 264fd67

Browse files
committed
Fix typo in exercise 6-4
The variable count is now properly incremented each time draw() is executed.
1 parent 2b19dbf commit 264fd67

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

chp06_loops/exercise_06_04_global_vs_local/exercise_06_04_global_vs_local.pde

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Daniel Shiffman
33
// http://www.learningprocessing.com
44

5-
// Exercise 6-4: Predict the results of the following two
5+
// Exercise 6-4: Predict the results of the following two
66
// programs. Test your theory by running them.
77

88
/*
@@ -20,7 +20,7 @@ void draw() {
2020
________
2121
2222
23-
23+
*/
2424
//SKETCH #2: Local "count"
2525

2626
void setup() {
@@ -29,8 +29,9 @@ void setup() {
2929

3030
void draw() {
3131
int count = 0;
32-
count = count = 1;
32+
count = count + 1;
3333
background(count);
3434
}
35+
/*
3536
________
3637
*/

0 commit comments

Comments
 (0)