SlideShare une entreprise Scribd logo
1  sur  10
Télécharger pour lire hors ligne
From last time…
for( int i = 0; i < 100; i++ ) {
println(“loops!”)
}
!

loops!
loops!
loops!
loops!
loops!
loops!
…
Homework 1

CAP
Tips
•

People who drew pictures made fewer mistakes!

•

You can run the code to verify!

•

Remember: the width and height arguments are
not from center; they are total width & height!

•

Review: weighted probabilities
Weighted
Probabilities

CAP
Variable Scope

CAP
System Memory
The Stack

Global Variables
Code

3b. “Pop” local variables
3a. “Push” local variables
2. Load global variables
1. Load the code into memory
Demo!
Variable Scope
Demo!
Asset Creation
Quiz Conditionals, & Loops
2!
Variables,
•

Primitive Types (int, float, boolean)!

•

Variable Declaration and Initialization!

•

System Variables (width, height, mouseX, etc.)!

•

The random() and constrain() functions!

•

Conditional Statements (if, else-if, else)!

•

Relational Operators ( <

•

Logical Operators ( &&

•

For Loops ( for( int i = 0; i < 15; i++) {} )

>
||

<=

>= != == )!

! )!
For next time…
•

Read and respond to your proposal feedback!!

•

Read Shiffman, p. 101–107 (Functions I)!

•

Quiz 2 – Variables, Conditionals, & Loops

Contenu connexe

En vedette (10)

Social media fox
Social media foxSocial media fox
Social media fox
 
White Paper: From Accounts Receivable to Smarter Receivables
White Paper: From Accounts Receivable to Smarter ReceivablesWhite Paper: From Accounts Receivable to Smarter Receivables
White Paper: From Accounts Receivable to Smarter Receivables
 
Wc unit 3 work place commuication
Wc unit 3 work place commuicationWc unit 3 work place commuication
Wc unit 3 work place commuication
 
2. Processing
2. Processing2. Processing
2. Processing
 
การคิดราคาต้นทุน
การคิดราคาต้นทุนการคิดราคาต้นทุน
การคิดราคาต้นทุน
 
27. Video I
27. Video I27. Video I
27. Video I
 
Arduino day
Arduino dayArduino day
Arduino day
 
21. Mathematics II
21. Mathematics II21. Mathematics II
21. Mathematics II
 
20140220pln final2
20140220pln final220140220pln final2
20140220pln final2
 
15. Final Project - Iteration 1
15. Final Project - Iteration 115. Final Project - Iteration 1
15. Final Project - Iteration 1
 

Similaire à 9. Loops II

An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
Cloudflare
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
BeScala
 

Similaire à 9. Loops II (20)

ICS3211 Lecture 08 2020
ICS3211 Lecture 08 2020ICS3211 Lecture 08 2020
ICS3211 Lecture 08 2020
 
4. Interaction
4. Interaction4. Interaction
4. Interaction
 
COMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and SoliCOMP 4026 Lecture 5 OpenFrameworks and Soli
COMP 4026 Lecture 5 OpenFrameworks and Soli
 
Begin with c++ Fekra Course #1
Begin with c++ Fekra Course #1Begin with c++ Fekra Course #1
Begin with c++ Fekra Course #1
 
11. Functions II
11. Functions II11. Functions II
11. Functions II
 
An Introduction to Go
An Introduction to GoAn Introduction to Go
An Introduction to Go
 
Slink into Elixir
Slink into ElixirSlink into Elixir
Slink into Elixir
 
Data types and Operators
Data types and OperatorsData types and Operators
Data types and Operators
 
The hangover: A "modern" (?) high performance approach to build an offensive ...
The hangover: A "modern" (?) high performance approach to build an offensive ...The hangover: A "modern" (?) high performance approach to build an offensive ...
The hangover: A "modern" (?) high performance approach to build an offensive ...
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Python: The Dynamic!
Python: The Dynamic!Python: The Dynamic!
Python: The Dynamic!
 
python ppt.pptx
python ppt.pptxpython ppt.pptx
python ppt.pptx
 
ScalaCheck
ScalaCheckScalaCheck
ScalaCheck
 
East Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
East Coast DevCon 2014: Programming in UE4 - A Quick Orientation for CodersEast Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
East Coast DevCon 2014: Programming in UE4 - A Quick Orientation for Coders
 
Taint analysis
Taint analysisTaint analysis
Taint analysis
 
Password Storage Sucks!
Password Storage Sucks!Password Storage Sucks!
Password Storage Sucks!
 
Jvm memory model
Jvm memory modelJvm memory model
Jvm memory model
 
Making is fun!
Making is fun!Making is fun!
Making is fun!
 
tick cross game
tick cross gametick cross game
tick cross game
 
Delphi L04 Controls P2
Delphi L04 Controls P2Delphi L04 Controls P2
Delphi L04 Controls P2
 

Plus de Joseph Murphy

Plus de Joseph Murphy (20)

32. Input I
32. Input I32. Input I
32. Input I
 
30. Text II
30. Text II30. Text II
30. Text II
 
29. Text I
29. Text I29. Text I
29. Text I
 
26. Images II
26. Images II26. Images II
26. Images II
 
25. Images I
25. Images I25. Images I
25. Images I
 
24. Translation & Rotation II
24. Translation & Rotation II24. Translation & Rotation II
24. Translation & Rotation II
 
23. Final Project Iteration II
23. Final Project Iteration II23. Final Project Iteration II
23. Final Project Iteration II
 
34. Final Project Iteration 3
34. Final Project Iteration 334. Final Project Iteration 3
34. Final Project Iteration 3
 
22. Translation & Rotation I
22. Translation & Rotation I22. Translation & Rotation I
22. Translation & Rotation I
 
19. Algorithms II
19. Algorithms II19. Algorithms II
19. Algorithms II
 
20. Mathematics I
20. Mathematics I20. Mathematics I
20. Mathematics I
 
A. Design Thinking Lecture
A. Design Thinking LectureA. Design Thinking Lecture
A. Design Thinking Lecture
 
14. Arrays I
14. Arrays I14. Arrays I
14. Arrays I
 
13. Objects II
13. Objects II13. Objects II
13. Objects II
 
12. Objects I
12. Objects I12. Objects I
12. Objects I
 
10. Function I
10. Function I10. Function I
10. Function I
 
8. Loops I
8. Loops I8. Loops I
8. Loops I
 
7. Conditionals II
7. Conditionals II7. Conditionals II
7. Conditionals II
 
6. Conditionals I
6. Conditionals I6. Conditionals I
6. Conditionals I
 
5. Variables
5. Variables5. Variables
5. Variables
 

Dernier

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 

Dernier (20)

Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

9. Loops II

  • 1. From last time… for( int i = 0; i < 100; i++ ) { println(“loops!”) } ! loops! loops! loops! loops! loops! loops! …
  • 3. Tips • People who drew pictures made fewer mistakes! • You can run the code to verify! • Remember: the width and height arguments are not from center; they are total width & height! • Review: weighted probabilities
  • 6. System Memory The Stack Global Variables Code 3b. “Pop” local variables 3a. “Push” local variables 2. Load global variables 1. Load the code into memory
  • 9. Quiz Conditionals, & Loops 2! Variables, • Primitive Types (int, float, boolean)! • Variable Declaration and Initialization! • System Variables (width, height, mouseX, etc.)! • The random() and constrain() functions! • Conditional Statements (if, else-if, else)! • Relational Operators ( < • Logical Operators ( && • For Loops ( for( int i = 0; i < 15; i++) {} ) > || <= >= != == )! ! )!
  • 10. For next time… • Read and respond to your proposal feedback!! • Read Shiffman, p. 101–107 (Functions I)! • Quiz 2 – Variables, Conditionals, & Loops