Successfully reported this slideshow.
Upcoming SlideShare
×

# 9. Loops II

149 views

Published on

Published in: Education
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

### 9. Loops II

1. 1. From last time… for( int i = 0; i < 100; i++ ) { println(“loops!”) } ! loops! loops! loops! loops! loops! loops! …
2. 2. Homework 1 CAP
3. 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
4. 4. Weighted Probabilities CAP
5. 5. Variable Scope CAP
6. 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
7. 7. Demo! Variable Scope
8. 8. Demo! Asset Creation
9. 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. 10. For next time… • Read and respond to your proposal feedback!! • Read Shiffman, p. 101–107 (Functions I)! • Quiz 2 – Variables, Conditionals, & Loops