# Teaching

### Site Tools

spcs:summer2014:day_6

# SPCS - Day 6

Afternoon Groups: (Rohan, Jon), (Jerry, Caelen), (Neel, Jonathan), (Tony, Rahul), (Akane, Olivia), (Vrinda, Nidhi), (Joyce, Sindhu), (Jannani, Christine, Maxine)

## Topics

• Week 1 Recap
• Object Oriented Programming
• Final Projects
• 3 types of prototypes
• Brandon Tearse at 10:00
• Sorting!
• Spend last 30 min on HTML

## Assignments

Welcome to week 2! Remember, blogging is NOT meant to be optional. Even if you don't want to spend time on it, just make it very short and sweet (1 link, 1 photo, 1 sentence).

Today we will do programming first.

### Part 1 - Mousey's Sort (Teams)

Mousey still needs to sort his cheese. Help him by making an animation that simulates sorting.

Edit: if this is too easy for you. Try animating another sort. Another challenge is to allow your sort to pause in the middle by pressing or clicking a button. How would you do this?

### Part 2 - Blog Mousey's sort

Describe the design, algorithm, and run-time (Big O) of your approach.

### Part 3 - Blog Final Project Topics

Please look at the list of topics. Pick three that you'd want to work on.

Each of the three must state what the topic is about and why you want to work on it.

Reminder: No skipping blogs, especially this one!

### Part 4 - Cookbook JS fighting (Team or Individual)

Go back to any of the previous Cookbook challenges, and work on them.

Try to create your own art using the pixel web app.

### Part 5 - Blogs and Github

Please take time to clean up your blogs and Github. We wanna all look pro :)

Don't lose any of your work. Check your repos back in when you are done.

### Code

```int cheesesticks [] = {21, 33, 44, 22 ,55 ,66 ,77, 33, 22, 11, 44, 33, 22, 11, 55 ,66, 5, 2, 100, 20};

int i = -1;
int j = 0;

int min;

void setup () {

size (800,800);

for (int k=0; k<20; k++)
println(cheesesticks[i]);

}

void draw () {

background(0);

// only runs after j reaches 20
if ((j == 20) && (i < 19)) {

i++;
j=i+1;
min = cheesesticks[i];
}

// runs as long as j is less than 20
if (j < 20) {

if (cheesesticks[j] < min){
min = cheesesticks[j];
int temp = cheesesticks[i];
cheesesticks[i] = cheesesticks[j];
cheesesticks[j] = temp;
}
j++;
}

// Draws the state of the cheesesticks
fill (0,0,255);

for (int l=0; l<20; l++)
{
rect(0, l*20, cheesesticks[l]*5, 10);
}

println("poop");

}```