SlideShare una empresa de Scribd logo
1 de 15
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; }

Más contenido relacionado

La actualidad más candente

adders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISAadders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISA
i i
 
Creating a Table from a Function
Creating a Table from a FunctionCreating a Table from a Function
Creating a Table from a Function
dmidgette
 
CRL 1.8 functions MrG 2011.0920 - sage
CRL 1.8 functions MrG 2011.0920  - sageCRL 1.8 functions MrG 2011.0920  - sage
CRL 1.8 functions MrG 2011.0920 - sage
A Jorge Garcia
 
Script clases ide bd espacial
Script clases ide   bd espacialScript clases ide   bd espacial
Script clases ide bd espacial
fulllcreeed
 
7 metode-secant
7 metode-secant7 metode-secant
7 metode-secant
Alen Pepa
 

La actualidad más candente (20)

The Ring programming language version 1.3 book - Part 40 of 88
The Ring programming language version 1.3 book - Part 40 of 88The Ring programming language version 1.3 book - Part 40 of 88
The Ring programming language version 1.3 book - Part 40 of 88
 
Array and pointer
Array and pointerArray and pointer
Array and pointer
 
adders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISAadders/subtractors, multiplexers, intro to ISA
adders/subtractors, multiplexers, intro to ISA
 
Creating a Table from a Function
Creating a Table from a FunctionCreating a Table from a Function
Creating a Table from a Function
 
Ass2 1 (2)
Ass2 1 (2)Ass2 1 (2)
Ass2 1 (2)
 
CRL 1.8 Functions
CRL 1.8 FunctionsCRL 1.8 Functions
CRL 1.8 Functions
 
CRL 1.8 functions MrG 2011.0920 - sage
CRL 1.8 functions MrG 2011.0920  - sageCRL 1.8 functions MrG 2011.0920  - sage
CRL 1.8 functions MrG 2011.0920 - sage
 
C Language Lecture 10
C Language Lecture 10C Language Lecture 10
C Language Lecture 10
 
Script clases ide bd espacial
Script clases ide   bd espacialScript clases ide   bd espacial
Script clases ide bd espacial
 
Mysql Functions with examples CBSE INDIA 11th class NCERT
Mysql Functions with examples CBSE INDIA 11th class NCERTMysql Functions with examples CBSE INDIA 11th class NCERT
Mysql Functions with examples CBSE INDIA 11th class NCERT
 
133467 p2a4
133467 p2a4133467 p2a4
133467 p2a4
 
NTU ML TENSORFLOW
NTU ML TENSORFLOWNTU ML TENSORFLOW
NTU ML TENSORFLOW
 
Advanced Concepts in Python
Advanced Concepts in PythonAdvanced Concepts in Python
Advanced Concepts in Python
 
Dr.nouh part summery
Dr.nouh part summeryDr.nouh part summery
Dr.nouh part summery
 
7 metode-secant
7 metode-secant7 metode-secant
7 metode-secant
 
Deep learning study 3
Deep learning study 3Deep learning study 3
Deep learning study 3
 
Java arrays
Java   arraysJava   arrays
Java arrays
 
Bb2
Bb2Bb2
Bb2
 
The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210The Ring programming language version 1.9 book - Part 60 of 210
The Ring programming language version 1.9 book - Part 60 of 210
 
Computational Linguistics week 10
 Computational Linguistics week 10 Computational Linguistics week 10
Computational Linguistics week 10
 

Similar a Programming for Artists and Designers: Week 2

Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arrays
Aseelhalees
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
anishgoel
 
11 1. multi-dimensional array eng
11 1. multi-dimensional array eng11 1. multi-dimensional array eng
11 1. multi-dimensional array eng
웅식 전
 
Include stdio. wps office (1)
Include  stdio. wps office (1)Include  stdio. wps office (1)
Include stdio. wps office (1)
NilayChavhan
 

Similar a Programming for Artists and Designers: Week 2 (20)

Multi dimensional arrays
Multi dimensional arraysMulti dimensional arrays
Multi dimensional arrays
 
C Language Lecture 11
C Language Lecture  11C Language Lecture  11
C Language Lecture 11
 
y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
 y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
y Bookmarks People Window Helo Online Derivative edusubmi tionassig.docx
 
Python.pdf
Python.pdfPython.pdf
Python.pdf
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
 
Java Arrays
Java ArraysJava Arrays
Java Arrays
 
11 1. multi-dimensional array eng
11 1. multi-dimensional array eng11 1. multi-dimensional array eng
11 1. multi-dimensional array eng
 
Chapter 13.pptx
Chapter 13.pptxChapter 13.pptx
Chapter 13.pptx
 
C arrays
C arraysC arrays
C arrays
 
Write Python for Speed
Write Python for SpeedWrite Python for Speed
Write Python for Speed
 
Java arrays
Java    arraysJava    arrays
Java arrays
 
Underscore
UnderscoreUnderscore
Underscore
 
Advance data structure & algorithm
Advance data structure & algorithmAdvance data structure & algorithm
Advance data structure & algorithm
 
Introducción a Elixir
Introducción a ElixirIntroducción a Elixir
Introducción a Elixir
 
Segment tree
Segment treeSegment tree
Segment tree
 
밑바닥부터 시작하는 의료 AI
밑바닥부터 시작하는 의료 AI밑바닥부터 시작하는 의료 AI
밑바닥부터 시작하는 의료 AI
 
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Programming Java - Lection 07 - Puzzlers - Lavrentyev FedorProgramming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
Programming Java - Lection 07 - Puzzlers - Lavrentyev Fedor
 
Python data structures
Python data structuresPython data structures
Python data structures
 
Include stdio. wps office (1)
Include  stdio. wps office (1)Include  stdio. wps office (1)
Include stdio. wps office (1)
 
SP-First-Lecture.ppt
SP-First-Lecture.pptSP-First-Lecture.ppt
SP-First-Lecture.ppt
 

Más de Tinker (7)

Programming for Artists and Designers: Week 3
Programming for Artists and Designers: Week 3Programming for Artists and Designers: Week 3
Programming for Artists and Designers: Week 3
 
Programming for Artists and Designers: Week1
Programming for Artists and Designers: Week1Programming for Artists and Designers: Week1
Programming for Artists and Designers: Week1
 
Milan Mobile Games
Milan Mobile GamesMilan Mobile Games
Milan Mobile Games
 
Arduino and Open Hardware
Arduino and Open HardwareArduino and Open Hardware
Arduino and Open Hardware
 
Playful
PlayfulPlayful
Playful
 
Ethernet Shield
Ethernet ShieldEthernet Shield
Ethernet Shield
 
XBee and RFID
XBee and RFIDXBee and RFID
XBee and RFID
 

Último

All Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
All Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort ServiceAll Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
All Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
Apsara Of India
 
💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service
💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service
💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service
Apsara Of India
 
Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.
soniya singh
 
💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
Apsara Of India
 
VIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call Girls
VIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call GirlsVIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call Girls
VIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call Girls
Apsara Of India
 
💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service
💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service
💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service
Apsara Of India
 
New Call Girls In Panipat 08168329307 Shamli Israna Escorts Service
New Call Girls In Panipat 08168329307 Shamli Israna Escorts ServiceNew Call Girls In Panipat 08168329307 Shamli Israna Escorts Service
New Call Girls In Panipat 08168329307 Shamli Israna Escorts Service
Apsara Of India
 

Último (20)

WhatsApp 📞 8448380779 ✅Call Girls In Bhangel Sector 102 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Bhangel Sector 102 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Bhangel Sector 102 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Bhangel Sector 102 ( Noida)
 
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
👉Chandigarh Call Girls 👉9878799926👉Just Call👉Chandigarh Call Girl In Chandiga...
 
All Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
All Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort ServiceAll Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
All Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
 
Rudraprayag call girls 📞 8617697112 At Low Cost Cash Payment Booking
Rudraprayag call girls 📞 8617697112 At Low Cost Cash Payment BookingRudraprayag call girls 📞 8617697112 At Low Cost Cash Payment Booking
Rudraprayag call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
High Class Call Girls in Bangalore 📱9136956627📱
High Class Call Girls in Bangalore 📱9136956627📱High Class Call Girls in Bangalore 📱9136956627📱
High Class Call Girls in Bangalore 📱9136956627📱
 
👉Chandigarh Call Girls 📞Book Now📞👉 9878799926 👉Zirakpur Call Girl Service No ...
👉Chandigarh Call Girls 📞Book Now📞👉 9878799926 👉Zirakpur Call Girl Service No ...👉Chandigarh Call Girls 📞Book Now📞👉 9878799926 👉Zirakpur Call Girl Service No ...
👉Chandigarh Call Girls 📞Book Now📞👉 9878799926 👉Zirakpur Call Girl Service No ...
 
💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service
💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service
💕COD Call Girls In Kurukshetra 08168329307 Pehowa Escort Service
 
gatiin-namaa-meeqa .pdf
gatiin-namaa-meeqa                        .pdfgatiin-namaa-meeqa                        .pdf
gatiin-namaa-meeqa .pdf
 
Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Govindpuri Escort Service Delhi N.C.R.
 
Call Girls in Bangalore Prachi 💋9136956627 Bangalore Call Girls
Call Girls in  Bangalore Prachi 💋9136956627 Bangalore Call GirlsCall Girls in  Bangalore Prachi 💋9136956627 Bangalore Call Girls
Call Girls in Bangalore Prachi 💋9136956627 Bangalore Call Girls
 
💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
💞5✨ Hotel Karnal Call Girls 08168329307 Noor Mahal Karnal Escort Service
 
Dubai Call Girls Phone O525547819 Take+ Call Girls Dubai=
Dubai Call Girls Phone O525547819 Take+ Call Girls Dubai=Dubai Call Girls Phone O525547819 Take+ Call Girls Dubai=
Dubai Call Girls Phone O525547819 Take+ Call Girls Dubai=
 
VIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call Girls
VIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call GirlsVIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call Girls
VIP 💞🌷Call Girls In Karnal 08168329307 Escorts Service Nilokheri Call Girls
 
💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service
💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service
💞Sexy Call Girls In Ambala 08168329307 Shahabad Call Girls Escort Service
 
UDAIPUR CALL GIRLS 96O287O969 CALL GIRL IN UDAIPUR ESCORT SERVICE
UDAIPUR CALL GIRLS 96O287O969 CALL GIRL IN UDAIPUR ESCORT SERVICEUDAIPUR CALL GIRLS 96O287O969 CALL GIRL IN UDAIPUR ESCORT SERVICE
UDAIPUR CALL GIRLS 96O287O969 CALL GIRL IN UDAIPUR ESCORT SERVICE
 
Nahan call girls 📞 8617697112 At Low Cost Cash Payment Booking
Nahan call girls 📞 8617697112 At Low Cost Cash Payment BookingNahan call girls 📞 8617697112 At Low Cost Cash Payment Booking
Nahan call girls 📞 8617697112 At Low Cost Cash Payment Booking
 
Russian CalDeed Circle Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Esco...
Russian CalDeed Circle Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Esco...Russian CalDeed Circle Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Esco...
Russian CalDeed Circle Call Girls Service ☎ ️93326-06886 ❤️‍🔥 Enjoy 24/7 Esco...
 
Call Girl In Zirakpur👧 Book Now📱7837612180 📞👉Zirakpur Call Girls Service No A...
Call Girl In Zirakpur👧 Book Now📱7837612180 📞👉Zirakpur Call Girls Service No A...Call Girl In Zirakpur👧 Book Now📱7837612180 📞👉Zirakpur Call Girls Service No A...
Call Girl In Zirakpur👧 Book Now📱7837612180 📞👉Zirakpur Call Girls Service No A...
 
New Call Girls In Panipat 08168329307 Shamli Israna Escorts Service
New Call Girls In Panipat 08168329307 Shamli Israna Escorts ServiceNew Call Girls In Panipat 08168329307 Shamli Israna Escorts Service
New Call Girls In Panipat 08168329307 Shamli Israna Escorts Service
 
"Maximizing your savings:The power of financial planning".pptx
"Maximizing your savings:The power of financial planning".pptx"Maximizing your savings:The power of financial planning".pptx
"Maximizing your savings:The power of financial planning".pptx
 

Programming for Artists and Designers: Week 2

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