• Like
Creative Coding 1 - 2 Variables
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Creative Coding 1 - 2 Variables

  • 361 views
Published

 

Published in Design
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
361
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
8
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Crea%ve  Coding  Interac%on  Design  Lab  1,  IUAV,  WS  10/11   Till  Nagel,  FH  Potsdam,  10/2010  
  • 2. Variables  
  • 3. Variables:  Data  types   int  count  =  0;   float  score  =  43.71;   char  letter  =  a;   boolean  niceWeather  =  true;  
  • 4. Variables:  Assign  values   int  x  =  0;   line(x,  10,  x,  200);   x  =  50;   line(x,  10,  x,  200);  
  • 5. Variables:  Assign  values   int  x  =  0;            //  ok   int  y  =  0.3;        //  error:  float  value   z  =  10;                  //  error:  not  declared   char  c  =  true;    //  error:  wrong  type  
  • 6. 1  +  2  +  3  +  4  +  5  =  ?  1  +  2          3  +  3                  6  +  4                        10  +  5  =  15  
  • 7. Variables:  Usage   int  sum  =  0;  
  • 8. Variables:  Usage   int  sum  =  0;   sum  =  1  +  2;  
  • 9. Variables:  Usage   int  sum  =  0;   sum  =  1  +  2;   sum  =  sum  +  3;  
  • 10. Variables:  Usage   int  sum  =  0;   sum  =  1  +  2;   sum  =  sum  +  3;   sum  =  sum  +  4;   sum  =  sum  +  5;  
  • 11. Variables:  Usage   int  sum  =  0;   sum  =  1  +  2;   sum  =  sum  +  3;   sum  =  sum  +  4;   sum  =  sum  +  5;   println(sum);  
  • 12. Expressions   int  a  =  3;   int  b  =  5;   int  c  =  a  +  b;   a  =  b  *  2;   c  =  c  +  a;  
  • 13. Expressions  in  statements   int  x  =  100;   int  y  =  20;   fill(x);   line(x,  y,  300,  y  *  2);  
  • 14. Special  Processing  variables  
  • 15. Sta%c  sketch    size(200,  200);    background(0);    line(100,  50,  0,  0);    ellipse(100,  100,  20,  20);  
  • 16. Dynamic  sketch   void  setup()  {    size(200,  200);    background(0);   }   void  draw()  {    line(100,  50,  0,  0);    ellipse(100,  100,  20,  20);   }  
  • 17. Dynamic  sketch   void  setup()  {    size(200,  200);    background(0);   }   void  draw()  {    line(100,  50,  mouseX,  mouseY);    ellipse(mouseX,  mouseY,  20,  20);   }  
  • 18. Excersises   E4:  Create  a  dynamic  interac.ve  line  composi.on.  
  • 19. Thank  you.   Copyright  Till  Nagel,  FH  Potsdam,  10/2010