Lab 9

Midterm prep

Agenda

  • Midterm Review
  • Midterm question overview

This week at a glance:

  • Midterm! 4/25/17
  • Arrays and Elli (4/28/17)
  • Controlling Elli (4/30/17)

Midterm Review!

Things to Focus on:

  • Lightbot
  • Abstraction
  • Binary encoding
  • Reviewing readings
  • Algorithmic Complexity
  • The Internet
  • For-loops, if-statements
  • Arrays
  • Debugging

Practice Questions

  • #9
  • #20
  • #22
  • #27

Debugging Question

This piece of code will make a 10 rectangles next to each other on the x-axis:

color c;

//bool click;

void setup() {

background(200);

c = color(0,0,0);

size(500, 500);

//click = false;

}

void draw() {

//background(200);

if (mousePressed) {

for (int i = 0; i < 10; i = i + 1) {

rect(mouseX + i*20, mouseY, 20, 20);

}

}

}

Review Problems

  • Any Questions?

GOOD LUCK! YOU’ll DO AMAZING!