Like this presentation? Why not share!

# Programming for Artists and Designers: Week 2

## by Tinker on Feb 01, 2010

• 607 views

Slides for the 2nd week of an introductory Processing course at the V&A

Slides for the 2nd week of an introductory Processing course at the V&A

### Views

Total Views
607
Views on SlideShare
607
Embed Views
0

Likes
0
Downloads
9
Comments
0

No embeds

### Upload Details

Uploaded via SlideShare as Microsoft PowerPoint

### Usage Rights

© All Rights Reserved

### Report content

Edit your comment

## Programming for Artists and Designers: Week 2Presentation Transcript

• Week 2: Fundamentals of Programming Variables, Arrays, For Loops, If Statements
• int centerX = 320; variables
• variables
• variables
• variables do not change can change
• variables
• a short break: println and detecting the mouse println ( mouseX + “ ” + mouseY );
• a short break: width and height ellipse ( width /2, height /2,100,100);
• arrays int [] centerX = new int [10];
• int [] centerX = { 0,0,1,1,2,2,3,3,4,4 }; arrays
• int [] centerX = new int [10]; arrays centerX[0]=0; centerX[1]=0; centerX[2]=1; centerX[3]=2; …and so on void setup (){
• int [] centerX = new int [10]; arrays… and for loops for ( int i = 0; i < 10; i++){ centerX[i] = i/2; } void setup (){ }
• for loops void setup (){ blahblahblah(); } void draw (){ blahblah(); for ( int i = 0; i < 20; i++){ blahblahblah(); blah[i] = blah[i] +1; } blahblah(); }
• if… else if ( mousePressed == true ){ do something; } else if ( keyPressed == true ){ do something else; } else { do something else; }
• if… else if (centerX < width /2){ do something; } else if (centerX >= 3* width /4){ do something else; } else { do something else; }