Skip to content

06_04_global_vc_local.pde line 28 #58

@computermusic

Description

@computermusic

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

/*
//SKETCH #1: Global "count"
int count = 0;

void setup() {
size(200,200);
}

void draw() {
count = count + 1;
background(count);
}


//SKETCH #2: Local "count"

void setup() {
size(200,200);
}

void draw() {
int count = 0;
count = count = 1; // This line is a mistake.
background(count);
}


*/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions