SlideShare une entreprise Scribd logo
1  sur  7
Télécharger pour lire hors ligne
TEA M TEAL



                     LIZ RUTLEDGE
DAY 8                rutle173@newschool.edu
August 10, 2011      esrutledge@gmail.com
agenda.

         Review:                         Learn:
         all that hard stuff.            FUNCTIONS! (woooooooot)

         namely:                         namely:
            for loops                      breaking down logic into
            mouse/keyboard interaction     custom functions
            if statements                  variable scope
            boolean “switches”




DAY 8
Tuesday, 10 Aug 2011
                                                                      CODE
                                                                      bootcamp 2011
homework
                                               now wasn’t that fun?




        googly eyes!
        questions?
        let’s look at a few!


        review:
        mouse interaction variables and
        functions
        the constrain() and dist() functions
        trigonometry (*gasp!*)
        anything else?




DAY 8
Tuesday, 10 Aug 2011
                                                           CODE
                                                           bootcamp 2011
functions!
                                                breaking down logic into reuseable little
                                                                         building blocks




       the concept:
       being able to separate out bits of logistics/syntax from your code
       to achieve several different results. notable benefits include:

              modularity: getting to reuse bits of code from place to place
              (like variables on crack)


              readability: by separating out all the crazy math and logic
              you can more easily see what’s going on when skimming back
              through




DAY 8
Tuesday, 10 Aug 2011
                                                                                 CODE
                                                                                 bootcamp 2011
how functions work.
                                                                              a quick example.




      void setup(){                                         void setup(){
           size(400,400);                   this:                size(400,400);
           strokeWeight(2);                                      strokeWeight(2);
           fill(255);                                            fill(255);
      }                                                     }

      void draw() {                                         void draw() {
           //set fill orange momentarily                         drawOrangeCircle();
           fill(255, 120, 0);
           //remove stroke momentarily                           //white square with 2pt stroke
           noStroke();                                           rect(100, 100, 50, 50);
           //draw circle
           ellipse(50,50,20,20);                                 drawOrangeCircle();
           //replace stroke                                 }
           strokeWeight(2);
           //replace fill                                   void drawOrangeCircle() {
           fillv(255);                                           //set fill orange momentarily
                                                                 fill(255, 120, 0);
           //white square with 2pt stroke                        //remove stroke momentarily
           rect(100, 100, 50, 50);                               noStroke();
                                                                 //draw circle
           //set fill orange momentarily                         ellipse(50,50,20,20);
           fill(255, 120, 0);                                    //replace stroke
           //remove stroke momentarily
           noStroke();                              turns        strokeWeight(2);
                                                                 //replace fill
           //draw circle
           ellipse(50,50,20,20);
                                                    into    }
                                                                 fill(255);

           //replace stroke
           strokeWeight(2);
                                                    this:
           //replace fill
           fill(255);
      }




DAY 8
Tuesday, 10 Aug 2011
                                                                                          CODE
                                                                                           bootcamp 2011
variable scope.
                                                                           functions aren’t all fun and games.




           the concept:
               “what happens in brackets stays in brackets”

           in english please?
               variables defined INSIDE a function can only be used inside THAT
               PARTICULAR function. (hint: think the i incrementing variable in a for loop)
               variables defined OUTSIDE of a function can be used in that and any
               other function on that same level. (we’re specifying “on that same level” because
               you can actually have a function...INSIDE a function. but we won’t worry about that yet.)




DAY 8
Tuesday, 10 Aug 2011
                                                                                                           CODE
                                                                                                           bootcamp 2011
homework.
                                                              due Thursday, August 11th.




      brainstorm!
      think about your final project ideas
      play around with potential tools/techniques you might want to use


      also:
      catch up on any oustanding assignments




DAY 8
Tuesday, 10 Aug 2011
                                                                                CODE
                                                                                bootcamp 2011

Contenu connexe

Similaire à Functions, Scope, and Homework for Code Bootcamp Day 8

Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6Liz 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 7
Bootcamp - Team TEAL - Day 7Bootcamp - Team TEAL - Day 7
Bootcamp - Team TEAL - Day 7Liz 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 5
Bootcamp - Team TEAL - Day 5Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Liz Rutledge
 
My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)abdels
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlinvriddhigupta
 

Similaire à Functions, Scope, and Homework for Code Bootcamp Day 8 (8)

Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6Bootcamp - Team TEAL - Day 6
Bootcamp - Team TEAL - Day 6
 
Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10Bootcamp - Team TEAL - Day 10
Bootcamp - Team TEAL - Day 10
 
Bootcamp - Team TEAL - Day 7
Bootcamp - Team TEAL - Day 7Bootcamp - Team TEAL - Day 7
Bootcamp - Team TEAL - Day 7
 
Bootcamp - Team TEAL - Day 4
Bootcamp - Team TEAL - Day 4Bootcamp - Team TEAL - Day 4
Bootcamp - Team TEAL - Day 4
 
Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5Bootcamp - Team TEAL - Day 5
Bootcamp - Team TEAL - Day 5
 
Let's Try Kotlin
Let's Try KotlinLet's Try Kotlin
Let's Try Kotlin
 
My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)My Adventures In Objective-C (A Rubyists Perspective)
My Adventures In Objective-C (A Rubyists Perspective)
 
Introduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in KotlinIntroduction to kotlin and OOP in Kotlin
Introduction to kotlin and OOP in Kotlin
 

Plus de Liz Rutledge

dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...Liz Rutledge
 
data_coach: midterm review + user testing plans
data_coach: midterm review + user testing plansdata_coach: midterm review + user testing plans
data_coach: midterm review + user testing plansLiz Rutledge
 
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...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 9
Bootcamp - Team TEAL - Day 9Bootcamp - Team TEAL - Day 9
Bootcamp - Team TEAL - Day 9Liz Rutledge
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Liz 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
 

Plus de Liz Rutledge (12)

dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
dataCoach Lacrosse: Data Tools for the Non-Professional Sports Community [The...
 
data_coach: midterm review + user testing plans
data_coach: midterm review + user testing plansdata_coach: midterm review + user testing plans
data_coach: midterm review + user testing plans
 
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...dataPlay: Sports Game Data Collection and Visualization [Information Design A...
dataPlay: Sports Game Data Collection and Visualization [Information Design A...
 
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 9
Bootcamp - Team TEAL - Day 9Bootcamp - Team TEAL - Day 9
Bootcamp - Team TEAL - Day 9
 
Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3Bootcamp - Team TEAL - Day 3
Bootcamp - Team TEAL - Day 3
 
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
 

Dernier

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 

Dernier (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Functions, Scope, and Homework for Code Bootcamp Day 8

  • 1. TEA M TEAL LIZ RUTLEDGE DAY 8 rutle173@newschool.edu August 10, 2011 esrutledge@gmail.com
  • 2. agenda. Review: Learn: all that hard stuff. FUNCTIONS! (woooooooot) namely: namely: for loops breaking down logic into mouse/keyboard interaction custom functions if statements variable scope boolean “switches” DAY 8 Tuesday, 10 Aug 2011 CODE bootcamp 2011
  • 3. homework now wasn’t that fun? googly eyes! questions? let’s look at a few! review: mouse interaction variables and functions the constrain() and dist() functions trigonometry (*gasp!*) anything else? DAY 8 Tuesday, 10 Aug 2011 CODE bootcamp 2011
  • 4. functions! breaking down logic into reuseable little building blocks the concept: being able to separate out bits of logistics/syntax from your code to achieve several different results. notable benefits include: modularity: getting to reuse bits of code from place to place (like variables on crack) readability: by separating out all the crazy math and logic you can more easily see what’s going on when skimming back through DAY 8 Tuesday, 10 Aug 2011 CODE bootcamp 2011
  • 5. how functions work. a quick example. void setup(){ void setup(){ size(400,400); this: size(400,400); strokeWeight(2); strokeWeight(2); fill(255); fill(255); } } void draw() { void draw() { //set fill orange momentarily drawOrangeCircle(); fill(255, 120, 0); //remove stroke momentarily //white square with 2pt stroke noStroke(); rect(100, 100, 50, 50); //draw circle ellipse(50,50,20,20); drawOrangeCircle(); //replace stroke } strokeWeight(2); //replace fill void drawOrangeCircle() { fillv(255); //set fill orange momentarily fill(255, 120, 0); //white square with 2pt stroke //remove stroke momentarily rect(100, 100, 50, 50); noStroke(); //draw circle //set fill orange momentarily ellipse(50,50,20,20); fill(255, 120, 0); //replace stroke //remove stroke momentarily noStroke(); turns strokeWeight(2); //replace fill //draw circle ellipse(50,50,20,20); into } fill(255); //replace stroke strokeWeight(2); this: //replace fill fill(255); } DAY 8 Tuesday, 10 Aug 2011 CODE bootcamp 2011
  • 6. variable scope. functions aren’t all fun and games. the concept: “what happens in brackets stays in brackets” in english please? variables defined INSIDE a function can only be used inside THAT PARTICULAR function. (hint: think the i incrementing variable in a for loop) variables defined OUTSIDE of a function can be used in that and any other function on that same level. (we’re specifying “on that same level” because you can actually have a function...INSIDE a function. but we won’t worry about that yet.) DAY 8 Tuesday, 10 Aug 2011 CODE bootcamp 2011
  • 7. homework. due Thursday, August 11th. brainstorm! think about your final project ideas play around with potential tools/techniques you might want to use also: catch up on any oustanding assignments DAY 8 Tuesday, 10 Aug 2011 CODE bootcamp 2011