SlideShare a Scribd company logo
1 of 9
Download to read offline
TEA M TEAL



                     LIZ RUTLEDGE
DAY 9                rutle173@newschool.edu
August 11, 2011      esrutledge@gmail.com
agenda.

         Review:                         Learn:
         whatever you want.              ARRAYS!!! (double-woooooooot!)

         likely candidates:              namely:
            custom functions               controlling a bunch of things
            for loops                      individually without having to
                                           write an entirely separate code
            if statements
                                           sequence for each one
            mouse/keyboard interaction
            boolean “switches”
                                           also: looping through arrays
                                           with a for loop




DAY 9
Tuesday, 11 Aug 2011
                                                                          CODE
                                                                          bootcamp 2011
homework

        brainstorming!
        questions?
        mind-blowing discoveries?
        new-found life goals?




                       http://vimeo.com/21651041

DAY 9
Tuesday, 11 Aug 2011
                                                   CODE
                                                   bootcamp 2011
arrays!
                                      storing lots of little things in one bigger list of things.




       the concept:
       being able to store lots of related variables in one place so that you
       can easily modify or control all those objects simultaneously

              portability: way easier to control a million little shapes if they’re
              all accessbile through the same array
              readability: by keeping all your variables of a certain kind in one
              place it’s easier to tell what you’re dealing with throughout the
              code (and easier to remember variable names!)
              scalability: you can increase the number of elements controlled
              by your arrays by changing a single number




DAY 9
Tuesday, 11 Aug 2011
                                                                                        CODE
                                                                                        bootcamp 2011
how arrays work.
                                                                       a quick example.




       // define list of grocery items
       to pick up at store as separate
                                                  this:
       variables

       String     grocery1   =   “beer”;
       String     grocery2   =   “milk”;
       String     grocery3   =   “bread”;
       String     grocery4   =   “eggs”;
       String     grocery5   =   “chocolate”;

                                                   // define list of grocery
                                                   items to pick up at store
                                                   as items in an array
                                                   String[] = new String[5];

                                          turns    groceries[0]   =   “beer”;
                                                   groceries[1]   =   “milk”;
                                          into     groceries[2]   =   “bread”;
                                          this:    groceries[3]
                                                   groceries[4]
                                                                  =
                                                                  =
                                                                      “eggs”;
                                                                      “chocolate”;




DAY 9
Tuesday, 11 Aug 2011
                                                                               CODE
                                                                                bootcamp 2011
how arrays work.
                                                           a quick example.




     except now we can refer to ALL of our groceries at once:


            println(grocery1);          this   println(groceries);
            println(grocery2);
            println(grocery3);                 // prints to the
            println(grocery4);                 console:

                                        vs.
            println(grocery5);                 [0] “beer”
                                               [1] “milk”
            // prints to the console:          [2] “bread”
            beer                               [3] “eggs”
            milk                               [4] “chocolate”
            bread
            eggs                        this
            chocolate




DAY 9
Tuesday, 11 Aug 2011
                                                                     CODE
                                                                     bootcamp 2011
arrays and for loops.
                                                                putting that handy index
                                                                                to work.




           the concept:
           looping through all the elements of an array

           in english please?
               remember how for loops increment through numbers? and how
               arrays are indexed by numbers? not a coincidence.
               we can use those same incrementing loops to do things to every
               element in an array with very little effort!




DAY 9
Tuesday, 11 Aug 2011
                                                                                CODE
                                                                                bootcamp 2011
arrays and for loops.
                                                            putting that handy index
                                                                            to work.




      example:
      looping through all the elements of an array

         for( int i = 0; i < 5; i++) {
           print(groceries[i]);           this
         }
                                                     println(grocery1);
                                                     println(grocery2);
                                          vs.
         // prints to the console:
                                                     println(grocery3);
         beer
                                                     println(grocery4);
         milk
                                                     println(grocery5);
         bread
         eggs
                                          the        // prints to the console:
         chocolate
                                                     beer
                                          old        milk
                                          way        bread
                                                     eggs
                                                     chocolate




DAY 9
Tuesday, 11 Aug 2011
                                                                            CODE
                                                                            bootcamp 2011
homework.
                                                                                              due Friday, August 12th.




      more bouncing ball[z]!
      Redo your bouncing ball(s) sketch using arrays to create 50 bouncing balls.
      The balls should have different sizes, colors, and speeds. (it’s okay if some overlap
      but no two balls should be exactly alike.)



      extra credit:
      make each ball change color (independently) when it hits a surface and
      bounces


      extra extra credit:
      store how many times each ball has bounced off a surface in another array
      (hint: if you print out that array, faster moving balls should have a higher number of bounces)




DAY 9
Tuesday, 11 Aug 2011
                                                                                                              CODE
                                                                                                              bootcamp 2011

More Related Content

More from Liz Rutledge

Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...Liz Rutledge
 
Information Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal ObservationsInformation Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal ObservationsLiz Rutledge
 
[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUSLiz Rutledge
 
[THESIS] Midterm Presentation
[THESIS] Midterm Presentation[THESIS] Midterm Presentation
[THESIS] Midterm PresentationLiz Rutledge
 
Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Liz Rutledge
 
Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8Liz Rutledge
 
Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6Liz Rutledge
 
Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Liz Rutledge
 
Bootcamp - Team TEAL - Day 4
Bootcamp - Team TEAL - Day 4Bootcamp - Team TEAL - Day 4
Bootcamp - Team TEAL - Day 4Liz Rutledge
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Liz Rutledge
 
Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2Liz Rutledge
 
Iris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesIris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesLiz Rutledge
 
DT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object PresentationDT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object PresentationLiz Rutledge
 
Follow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space ProjectFollow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space ProjectLiz Rutledge
 

More from Liz Rutledge (14)

Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
Info Design in the Urban Environment | Perception + Discernment, Wayfinding, ...
 
Information Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal ObservationsInformation Design in the Urban Environment: Personal Observations
Information Design in the Urban Environment: Personal Observations
 
[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS[THESIS] Final Presentation: GametimePLUS
[THESIS] Final Presentation: GametimePLUS
 
[THESIS] Midterm Presentation
[THESIS] Midterm Presentation[THESIS] Midterm Presentation
[THESIS] Midterm Presentation
 
Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10
 
Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8Bootcamp - Team TEAL - Day 8
Bootcamp - Team TEAL - Day 8
 
Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6
 
Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5
 
Bootcamp - Team TEAL - Day 4
Bootcamp - Team TEAL - Day 4Bootcamp - Team TEAL - Day 4
Bootcamp - Team TEAL - Day 4
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3
 
Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2Bootcamp - TEAM TEAL - Day 2
Bootcamp - TEAM TEAL - Day 2
 
Iris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory AccessoriesIris+Olivia | Tech Accessory Accessories
Iris+Olivia | Tech Accessory Accessories
 
DT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object PresentationDT Outfitters | Designed Object Presentation
DT Outfitters | Designed Object Presentation
 
Follow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space ProjectFollow the Mellow Brick Glow | An Augmented Space Project
Follow the Mellow Brick Glow | An Augmented Space Project
 

Recently uploaded

↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...noor ahmed
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...rahim quresi
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...Riya Pathan
 
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...noor ahmed
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl GoaRussian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goasexy call girls service in goa
 
Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...
Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...
Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...anamikaraghav4
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...aamir
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914Delhi Call girls
 
Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...
Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...
Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...Apsara Of India
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448ont65320
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...ritikasharma
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Serviceanamikaraghav4
 
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Serviceanamikaraghav4
 

Recently uploaded (20)

↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
↑Top Model (Kolkata) Call Girls Howrah ⟟ 8250192130 ⟟ High Class Call Girl In...
 
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
Science City Kolkata ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sex...
 
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Manjri Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service NashikCall Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
Call Girl Nashik Amaira 7001305949 Independent Escort Service Nashik
 
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
Independent Hatiara Escorts ✔ 8250192130 ✔ Full Night With Room Online Bookin...
 
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(DIVYA) Dhanori Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
Call Girls New Ashok Nagar Delhi WhatsApp Number 9711199171
 
Call Girls South Avenue Delhi WhatsApp Number 9711199171
Call Girls South Avenue Delhi WhatsApp Number 9711199171Call Girls South Avenue Delhi WhatsApp Number 9711199171
Call Girls South Avenue Delhi WhatsApp Number 9711199171
 
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
Book Paid Sonagachi Call Girls Kolkata 𖠋 8250192130 𖠋Low Budget Full Independ...
 
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service NashikCall Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
Call Girl Nashik Saloni 7001305949 Independent Escort Service Nashik
 
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl GoaRussian Escorts Agency In Goa  💚 9316020077 💚 Russian Call Girl Goa
Russian Escorts Agency In Goa 💚 9316020077 💚 Russian Call Girl Goa
 
Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...
Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...
Call Girls Service Bantala - Call 8250192130 Rs-3500 with A/C Room Cash on De...
 
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
Nayabad Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Sex At ...
 
2k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 92055419142k Shot Call girls Laxmi Nagar Delhi 9205541914
2k Shot Call girls Laxmi Nagar Delhi 9205541914
 
Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...
Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...
Karnal Call Girls 8860008073 Dyal Singh Colony Call Girls Service in Karnal E...
 
Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448Beautiful 😋 Call girls in Lahore 03210033448
Beautiful 😋 Call girls in Lahore 03210033448
 
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
Behala ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Ready ...
 
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Shyam Bazar 💫💫7001035870 Model escorts Service
 
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service👙  Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
👙 Kolkata Call Girls Sonagachi 💫💫7001035870 Model escorts Service
 
Goa Call "Girls Service 9316020077 Call "Girls in Goa
Goa Call "Girls  Service   9316020077 Call "Girls in GoaGoa Call "Girls  Service   9316020077 Call "Girls in Goa
Goa Call "Girls Service 9316020077 Call "Girls in Goa
 

Bootcamp - Team TEAL - Day 9

  • 1. TEA M TEAL LIZ RUTLEDGE DAY 9 rutle173@newschool.edu August 11, 2011 esrutledge@gmail.com
  • 2. agenda. Review: Learn: whatever you want. ARRAYS!!! (double-woooooooot!) likely candidates: namely: custom functions controlling a bunch of things for loops individually without having to write an entirely separate code if statements sequence for each one mouse/keyboard interaction boolean “switches” also: looping through arrays with a for loop DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 3. homework brainstorming! questions? mind-blowing discoveries? new-found life goals? http://vimeo.com/21651041 DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 4. arrays! storing lots of little things in one bigger list of things. the concept: being able to store lots of related variables in one place so that you can easily modify or control all those objects simultaneously portability: way easier to control a million little shapes if they’re all accessbile through the same array readability: by keeping all your variables of a certain kind in one place it’s easier to tell what you’re dealing with throughout the code (and easier to remember variable names!) scalability: you can increase the number of elements controlled by your arrays by changing a single number DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 5. how arrays work. a quick example. // define list of grocery items to pick up at store as separate this: variables String grocery1 = “beer”; String grocery2 = “milk”; String grocery3 = “bread”; String grocery4 = “eggs”; String grocery5 = “chocolate”; // define list of grocery items to pick up at store as items in an array String[] = new String[5]; turns groceries[0] = “beer”; groceries[1] = “milk”; into groceries[2] = “bread”; this: groceries[3] groceries[4] = = “eggs”; “chocolate”; DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 6. how arrays work. a quick example. except now we can refer to ALL of our groceries at once: println(grocery1); this println(groceries); println(grocery2); println(grocery3); // prints to the println(grocery4); console: vs. println(grocery5); [0] “beer” [1] “milk” // prints to the console: [2] “bread” beer [3] “eggs” milk [4] “chocolate” bread eggs this chocolate DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 7. arrays and for loops. putting that handy index to work. the concept: looping through all the elements of an array in english please? remember how for loops increment through numbers? and how arrays are indexed by numbers? not a coincidence. we can use those same incrementing loops to do things to every element in an array with very little effort! DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 8. arrays and for loops. putting that handy index to work. example: looping through all the elements of an array for( int i = 0; i < 5; i++) { print(groceries[i]); this } println(grocery1); println(grocery2); vs. // prints to the console: println(grocery3); beer println(grocery4); milk println(grocery5); bread eggs the // prints to the console: chocolate beer old milk way bread eggs chocolate DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011
  • 9. homework. due Friday, August 12th. more bouncing ball[z]! Redo your bouncing ball(s) sketch using arrays to create 50 bouncing balls. The balls should have different sizes, colors, and speeds. (it’s okay if some overlap but no two balls should be exactly alike.) extra credit: make each ball change color (independently) when it hits a surface and bounces extra extra credit: store how many times each ball has bounced off a surface in another array (hint: if you print out that array, faster moving balls should have a higher number of bounces) DAY 9 Tuesday, 11 Aug 2011 CODE bootcamp 2011