Computer Science 10 2016/17
Block 1 - Semester 1
CS10 Lessons
Notes to Teachers
Remaining Classes
66 - Mon. Dec. 12 | Game Maker Mini-Project |
67 | Detailed description of project Intro to object oriented programming in Processing |
68 | Experiment day |
69 | Formal Planning Time |
70 | Work Class #1, Plan due |
71 - Mon. Dec. 19 | Work Class #2 |
72 | Work Class #3 |
73 | Work Class #4 |
74 | Prototyping day |
75 - Fri. Dec. 23 | Fun day, watch ted talk |
76 - Mon. Jan.9 | Work Class #5 |
77 | Work Class #6 |
78 | Work Class #7 |
79 | Work Class #8 |
80 | Work Class #9 |
81 - Mon. Jan. 16 | Preliminary Marking Work Class #10 |
82 | Final Marking |
83 - Wed. Jan.18 | We play, Game of the year voting |
Class 81 & 82 - Last 2 days of course
Ensure students have finished self evaluations
Create Executable Files for putting on the S: drive
Nominate Game of the Year
Class 80 - Monday, Jan. 16
Prep: Photocopy Rubrics
Marking and continuous improvement
Ensure N-Event keys are in place. You will lose “Technical” marks if it is not.
How to Create an Executable Program
Nominate your neighbours and/or yourself for the following categories for Game of the Year:
Class 77-79 - Jan. 11-13
Discuss next year’s Cyberpatriot Teams.
Finish up project
Class 76 - Tuesday, Jan. 10
Discuss Benefits of Taking CS20 (on next page)
Differences between 20 Regular and 20 AP
4 days remaining in full project time
Benefits of Computing Science
CS20 Regular - 5 Credits
AP Program
Class 75 - Monday, Jan. 9
Have each student open the marking rubric.
Start to talk about CS20 - base your decisison on the SP2 credit
Class 71 - Monday, Dec 19
Aidan, Tait and Eve are Do Not Admit and should be sent to the Scona Room. Be sure to check for additions.
Today is considered Day 3
Put out exam dividers for block 2
Friday
Go over the planning page specifics as I was away. This is considered Day 2.
Talk about the Prototype day on Thursday
Class 69 - Thursday, Dec. 15
Day 9 of CSE Project A, 17 classes remaining
Complete the Planning page
Timeline of Goals
By the end of Day 3 Wednesday, Dec. 21st, I should have completed:
By the end of Day 6 Tuesday, Jan. 10___ I should have completed:
By the end of _Day 9, Friday Jan. 13__ I should have completed:
Day 11-13 Marking and Game Of The Year comp.
Class 68 - Wednesday, Dec. 14
Day 8 of CSE Project A, 18 classes remaining
Discuss the details of the project and the rubric (see below)
Discuss the expectations of the planning page (to be completed on Thursday)
Work time day 1
Introduce the major project
There are 4 major project types:
Class 66 - Tuesday, Dec. 13
Day 7 of CSE Project A, 19 classes remaining
Prep: Save OOP Example to the S: drive
Do next year - I was sick and did not do this.
Prep: Save OOP Example to the S: drive
One Last Processing Lesson - Object Oriented Programming
OOP Car V1 - Based on Learn Processing.org
OOP Car V2 - Based on http://learningprocessing.com/examples/chp08/example-08-02-twoobjects
Version 1 - // Example 8-1: A Car class and a Car object
Car myCar; // Declare car object as a globle variable.
void setup() {
size(480, 270);
// Initialize car object in setup() by calling constructor.
myCar = new Car();
}
void draw() {
background(255);
// Operate Car object in draw() by calling
// object methods using the dot syntax.
//myCar.move();
//myCar.display();
}
// Define a class outside of setup and draw.
class Car {
// Variables.
color c;
float xpos;
float ypos;
float xspeed;
// A constructor.
Car() {
c = color(175);
xpos = width/2;
ypos = height/2;
xspeed = 1;
}
// Function.
void display() {
// The car is just a square
rectMode(CENTER);
stroke(0);
fill(c);
rect(xpos, ypos, 20, 10);
}
// Function.
void move() {
xpos = xpos + xspeed;
if (xpos > width) {
xpos = 0;
}
}
}
Class 65 - Monday, Dec. 12 - Sub was here
Day 6 of CSE Project A, 20 classes remaining
Prep:
Discuss Client Side Scripting Marking
Game Maker Mini-Project
Discuss Final Project timelines
Some more time to try out sample projects
Class 64 - Friday, Dec. 9
Day 5 of CSE Project A, 20 classes remaining
Prep:
Find 5 Minute Flappy
Create start file with:
5-Minute Flappy
Use a platform game to demonstrate
Gravity and Platform Games
Class 63 - Thursday, Dec. 8
Day 5 of CSE Project A, 20 classes remaining
Prep:
Game Maker Lesson - Basic Shooting
Lives and Health
Better Movement Lesson - GasAndBreakPedal Gas
Game Maker Lesson - Gravity
Give them time to try out old projects and games
Class 62 - Wednesday, Dec. 7
Day 4 of CSE Project A
Prep: Prepare Pong, Photocopy HTML Marking sheets
Alter Shooting_start to include a goodguy and 3 separate goodguy bullets
Get GasAndBrake setup
Science of Fun
Next time: rework the Shooting_Start file to reflect bio-informatics
Class 61 - Tuesday, Dec. 6
Day 3 of CSE Project A
Prep:
Html Marking
Pong Level 2
Demo how to change levels with “Test Instance Count”
Science of Fun
Brick Breaker Assignment
Class 60 - Monday, Dec. 5
Day 2 of CSE Project A
Prep: Prepare Pong, Photocopy HTML Marking sheets
Mark HTML 1-3
Start with a new file as so many were absent Friday
Pong Level 1 2016
Pong Level 2
Class 59 - Friday, Dec. 2
Day 1 of CSE Project A
Prep: can we open old Game Maker files off the S: drive?
Discuss Project Credit
Likely evaluation
Why Game Maker
Change Settings:
Game Maker Lesson 1
Introduction to Game Maker
Complete Catch the Clown Tutorial Together
Class 58 - Thursday, My Birthday
Day 10 of Client Side Scripting
Prep: can we open old Game Maker files off the S: drive?
10 minute challenge
Introduce Assignment 5
Test Game Maker
Last Work time
Class 57 - Wednesday, Nov. 30
Day 9 of Client Side Scripting
Java Script Examples Projects
Finish installing Game Maker
Work time:
Assignments 1, 2, 3 - skills demonstrated in these assignments worth 70%
How Internet Works - worth 20%
Assign 4 - worth 10%
Class 56 - Tuesday, Nov. 29
Day 8 of Client Side Scripting
Pick a day this week when everyone is here and install Game Maker
Quick tips - Content Div with body background-image
Review of Form Objects
Setting InnerHTML
Intro to JavaScript
Retrieve from Text Box (see next page)
Browser Storage
Work time on assignments.
Storage, Inner HTML and Form code
Using External .JS file
<script src="myScript.js"></script>
Setting InnerHtml
<div id="result"></div>
document.getElementById("result").innerHTML = ("lastname");
Retrieve from TextBox
</script>
First Name: <input type="text" id="myText" value="Mickey">
<p>Click the button to display the value of the value attribute of the text field.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myText").value;
document.getElementById("demo").innerHTML = x;
}
</script>
Accessing Browser Storage
<script>
// Check browser support
if (typeof(Storage) !== "undefined") {
// Store
localStorage.setItem("lastname", "Smith");
// Retrieve
document.getElementById("result").innerHTML = localStorage.getItem("lastname");
} else {
document.getElementById("result").innerHTML = "Sorry, your browser does not support Web Storage...";
}
Class 55 - Monday, Nov. 28
Day 8 of Client Side Scripting
Discuss Web 1.0 vs 2.0 vs 3.0 and beyond
Introduction to Form Objects
Work time on Assignment 2& 3 (and 4 if they are aiming for 90%+)
Class 55 - Friday, Nov. 25
Day 7 of Client Side Scripting
Prep: Marking scheme for assignments 1 and 2, get CSS code copied into here
How the Internet Works Assignment
Finish Assign 2 and start 3
Mark Assign 2
Class 54 - Thursday, Nov. 4
Day 7 of Client Side Scripting
Prep: Marking scheme for assignments 1 and 2, get CSS code copied into here
New Div Example - may want to do this first
HTML Div Continued
HTML Assignment 2
Class 53 - Wednesday, Nov. 23
Day 6 of Client Side Scripting
Prep:
Using a separate CSS Style Sheet
YouTube Video: The Art of Web Design
http://www.youtube.com/watch?v=3iVVM_DgWY4&safety_mode=true&persist_safety_mode=1&safe=active
How do you pick good colors?
HTML Div
border: 2px solid red;
border-radius: 5px;
HTML Assignment 2
Next year: Possibly update how Internet works
How the Internet Works - https://developer.mozilla.org/en-US/docs/Learn/Common_questions/How_does_the_Internet_work
How the Web Works - https://developer.mozilla.org/en-US/docs/Learn/Getting_started_with_the_web/How_the_Web_works
Domain Names - https://developer.mozilla.org/en-US/docs/Learn/Common_questions/What_is_a_domain_nam
Class 52 - Tuesday, Nov. 22
Day 5 of Client Side Scripting
Prep:
Guest Speaker - Marty Dugas, Ronald McDonald House
Class 51 - Monday, Nov. 21
Day 4 of Client Side Scripting
Prep:
What is a Protocol
Header Based Styles
Introduce the idea of Layout tools:
HTML Tables
Finish Assignment 1 - Band Members
Class 50 - Friday, Nov. 18
Day 3 of Client Side Scripting
Prep:
How does an IP address work
Quick Review and New:
Assignment 1 - Band Members
Class 49 - Thursday, Nov. 17
Day 2 of Client Side Scripting
Prep:
Mark How Memory Works and Careers
Video #1 - Ted Talk: Andrew Blum - discover the physical side of the Internet (12:00)
Review all - Internet Hardware
Assignment 0 - Basic Tags practice
New Code
Assignment 1 - Band Members
Class 48 - Wednesday, Nov. 16
Day 1 of Client Side Scripting
Prep: Bring old book, Ask Alexandrina what country she is from
Block 1 Test Takers at lunch today or afterschool in Study hall? - Alexandrina, Thomas M, Sam, Harry
This credit worked pretty well. May want to add a quiz of some kind, perhaps something to test basic html outside of creating a website?
Announcement: Tentative Final grades for Structured Programming 2 have been released to SchoolZone. Feel free to talk to me about the details and/or to question a final grade.
Discuss Theory as it stands:
Discuss the Client Side Scripting Credit
The Science, Software and languages of the web
Do a one day introduction to web design, html and brackets. (see next page)
Introduce the following additional concepts
Assignment 0 - Basic Tags practice
Class 47 - Wednesday, Nov. 9
Day 8 of Computer Science 1
Prep: photocopy test
Discuss test
Class 46 - Tuesday, Nov. 8
Day 7 of Computer Science 1
Prep: photocopy extra crosswords,check on Kahoot
Zuckerberg
Jeopardy- http://www.jeopardyapp.com/play/cs1-theory-review
Complete Someone else’s crossword
Kahoot made by other students (if available)
Look up the Amazing Race stuff for next time. It is good and works well with the right class.
Ted Talk on Computer Virues - http://www.ted.com/talks/mikko_hypponen_fighting_viruses_defending_the_net (17:31)
Class 45 - Monday, Nov. 7
Day 6 of Computer Science 1
Prep: determine who needs logic gates help
Talk about the Scona Initiative.
Binary and Logic Gates practice
Zuckerberg
Careers Assignment
Discuss Processing Marking
Class 44 - Friday, Nov. 5
Day 5 of Computer Science 1
Prep: determine who needs logic gates help
Emerging Tech - Quantum Computers
Make a Crossword Puzzle
Biography #2 - Grace Hopper, http://fivethirtyeight.com/features/the-queen-of-code/ (16:30)
Biography #3 - Who was Turing: https://www.youtube.com/watch?v=Btqro3544p8 (3:30)
Zuckerberg/Catch up time
Class 43 - Thursday, Nov. 4
Day 4 of Computer Science 1
Prep: determine who needs logic gates help
Network video?Network Ethics video: http://vimeo.com/34750078
Emerging Tech: Big Data (Ted Talk about using data to cure hunger - 11:15)
Processing Self Assessment
How Memory Works Assignment
Biography #2 - Grace Hopper, http://fivethirtyeight.com/features/the-queen-of-code/ (16:30)
Who was Turing: https://www.youtube.com/watch?v=Btqro3544p8 (3:30)
One on one instruction on logic gates for those that need the review
Class 42 - Wednesday, Nov. 3
Day 3 of Computer Science 1
Prep: determine who needs logic gates help
Emerging Tech: Day made of glass
Emerging Tech: SSDs
Review the types of storage by placing boxes of appropriate size around the room:
Review other parts that we did not record answers for:
Finish Buy a Computer
Biography of Larry Page and Sergei Brin - Bloomberg video (25:35) https://www.youtube.com/watch?v=gtMkq6IxVKk
One on one instruction during biography for logic gates.
End of Day on Wednesday
Mark the Hunger, Rock or Tic assignment & Self Assessment?
Class 41 - Tuesday, Nov. 1
Day 2 of Computer Science 1
Emerging Tech
Computer Tech Solutions : How Does a Microprocessor Work? (2:34)
Talk about the Von Neumann Machine
Memory Pyramid
Buy A Computer Assignment
Class 40 - Halloween
Day 1 of CS Theory
Get Reza to reorganize his drive. Set up folder for each month.
Talk to James H, Jeff H, Lucian about his casino not working properly
Intro to Lucid Charts - Create a new Lucid Chart doc for CS Careers & Emerging Tech
Remind them and record the concepts we have discussed so far and add them under a category:
Emerging Tech and Careers- Bioinformatics and Bionics (19:00 but important enough to show)
http://www.ted.com/talks/hugh_herr_the_new_bionics_that_let_us_run_climb_and_dance
Give last 30 minutes of class to finish up Processing. This is bonus time.
Class 39 - Friday, Oct. 28
Day 16 of Structured Programming 2
Get Reza to reorganize his drive. Set up folder for each month.
Talk to James H, Jeff H, Lucian about his casino not working properly
Mark Hunger Games, Tic tac toe, Rock, Paper Scissors
Last class time for Wrap Up Project
Class 37 - Wednesday, Oct. 26 & Class 38 - Thursday, Oct. 27
Day 14 of Structured Programming 2
Types of Software Assignment
Work on Wrap Up Project
Class 36 - Tuesday, Oct. 25
Day 13 of Structured Programming 2
New: Focus on careers a bit more and less about biographies? Create a new careers activity using the Careerswithcode.com magazine.
Notes on the 4 types of software
Focus on Malware
Work on Wrap Up Project
4 Types of Software
Operating System
Applications
Utilities
Malware
Types of Malware
Virus
Trojan Horse
Worm
Ransomware, Adware, Spyware, Phishing, Spam
Class 35 - Monday, Oct. 24
Day 12 of Structured Programming 2
Thoroughly explain the Wrap Up project
Give them 10 minutes to try out past projects
Computer Theory Lesson 1 - Types of Software
Class 34 - Thursday, Oct. 20
Day 11 of Structured Programming 2
Catch up time or go to Volleyball
Class 33 - Wednesday, Oct. 19
Day 10 of Structured Programming 2
Be ready to mark Game Show/Dice Game for those that are done.
Talk to them about Thursday’s class
Work time on Assignment 4 (Hunger, Tic)
Class 32 - Tuesday, Oct. 18
Day 9 of Structured Programming 2
Students that missed the Binary exam to write today: James Chen, Colby Johannsen, Josh Pearce, Tait Richards
Work time on Assignment 3 (Game Show/Dice Game)
Introduce buttons
Work time on Assignment 4 (Hunger, Rock or Tic)
Class 31 - Monday, Oct. 17
Day 8 of Structured Programming 2
Students that missed the Binary exam: James Chen, Colby Johannsen, Josh Pearce, Tait Richards
Animating Scenes Demo
Int black=0 (global variable)
if(sceneNum==3)
fill(black)
text(“Join the darkside”, 50,150);
Black += 5
OR preferably:
If (sceneNum==3) call scene 3 over and over.
Work time on Assignment 3 Game Show/Dice Game
Add a button lesson and a small assignment to go with it (perhaps ramp up the drawing program from SP1). OR perhaps this can be worked into the quiz. They are all asking how to do buttons anyway and then they are on their own for collision events.
Class 30 - Friday, Oct. 14
Day 7 of Structured Programming 2
Prep: put out dividers for test
Logic Gates and Binary Text
Adventure Game (Star Wars) Demo
Introduce the Game Show/Dice Game assignment
Students must finish the Number Game base version first.
// this is going to show you how to use variables to move between scenes
PFont f1;
PFont f2;
int sceneNum = 1;
PImage PicMain;
boolean isJedi = false;
void setup() {
size(800, 200);
background (0);
PicMain = loadImage("scene1.jpg");
f1 = createFont("ravie",20);
f2 = createFont("cambria",20);
scene1();
}
tex
void draw() {
image(PicMain, 600, 0, 200, 200);
}
void keyPressed() {
if(key == 'r' && sceneNum==1){
scene3();
sceneNum=3;
} else if(key == 'f' && sceneNum==1){
scene2();
sceneNum=2;
} else if(key =='f' && sceneNum==2){
scene5();
sceneNum=5;
} else if (key == 't'){
isJedi = true;
//at some point in the game, you get the
//opportunity to train with yoda
} else if (key == 'd' && sceneNum==2){
joinDark();
sceneNum = 4;
}
}
//custom functions
void scene1() {
//background(0);
textFont(f1,20);
text(" A long time ago in a Galaxy far, far away....",20,20);
textFont(f2,14);
text("Do you want to find the evil Emperor(press f) or run away (press r)", 20,60);
PicMain = loadImage("scene1.jpg");
}//end scene1
void scene2(){
background(0);
sceneNum=2;
text("You are confronted by the evil Darth Vader.\nHe is very powerful", 20,20);
text("Press d to join the dark side or f to fight", 20,60);
PicMain = loadImage("scene2.jpg");
} //end scene2
void scene3(){
background(0);
//lets add a randomizer to see if you win or lose
int randNum = (int)random(0,2);
println("Random Number: " + randNum);
if(randNum==0){
text("You get Jedi help to defeat the empire",20,20);
text("You win", 20,40);
} else {
text("You are forced to hide forever on a deserted planet",20,20);
text("You lose", 20,40);
}
PicMain = loadImage("scene3.jpg");
}//end scene3
/**********************************create a scene 4 for joining the dark side**************************************/
void joinDark(){
background(0);
text("You and your daddy rule the galaxy forever.!", 20,20);
}
void scene5(){
background(0);
sceneNum=5;
if(isJedi){
text("Yoda has trained you well.", 20,20);
text("You use your mad light-sabering skills to defeat evil.\nVictory is yours", 20,40);
} else {
text("Your arm gets cut off but you are rescued.", 20,20);
text("Go live in shame on a far off planet!", 20,40);
}
PicMain = loadImage("scene2.jpg");
} //end scene5
Class 29 - Thursday, Oct. 13
Day 6 of Structured Programming 2
Logic Gates and Binary Practice
Catch Up Day
Class 28 - Wednesday, Oct. 12
Day 5 of Structured Programming 2
Logic Gates and Binary Practice
Boolean Variables and Custom Functions - Hunger Games Game example
Number Guess
Hunger Games Example Code
//Katniss, Prim, Effie, Peta, Hamish, Snow
boolean isFemale = false;
boolean inCapital = false;
boolean isDrunk = false;
boolean isTribute = false;
int questNum = 1;
void setup(){
size(600,200);
background(0);
text("Welcome to the 2016 Hunger Games Game.", 50,50);
question1();
}//end setup
void draw(){
}//end draw
void keyPressed(){
if (key == 'y' && questNum == 1){
isFemale = true;
questNum = 2;
question2();
} else if (key == 'n' && questNum == 1){
questNum = 2;
question2();
}
else if (key == 'y' && questNum == 2){
inCapital = true;
questNum = 3;
question3();
} else if (key == 'n' && questNum == 2){
questNum = 3;
question3();
}
else if (key == 'y' && questNum == 3){
inCapital = true;
questNum = 4;
question4();
} else if (key == 'n' && questNum == 3){
questNum = 4;
question4();
}
else if (key == 'y' && questNum == 4){
isTribute= true;
guessAnswer();
} else if (key == 'n' && questNum == 4){
guessAnswer();
}
}//end keyPressed
void question1(){
fill(0);
rect(0,100,600,100);
fill(200,200,50);
text("Is your character female? (y or n)", 50,150);
}//end q1
void question2(){
fill(0);
rect(0,100,600,100);
fill(200,200,50);
text("Does your character live in the capital? (y or n)", 50,150);
}//end q2
void question3(){
fill(0);
rect(0,100,600,100);
fill(200,200,50);
text("Is your character a heavy drinker? (y or n)", 50,150);
}//end q3
void question4(){
fill(0);
rect(0,100,600,100);
fill(200,200,50);
text("Was your character ever a tribute? (y or n)", 50,150);
}//end q4
void guessAnswer(){
background(0);
if (isFemale && !inCapital && !isDrunk && isTribute){
text("You were thinking of Katniss", 50,50);
}
else if (isFemale && !inCapital && !isDrunk && !isTribute){
text("You were thinking of Prim", 50,50);
}
else if (isFemale && inCapital && !isDrunk && !isTribute){
text("You were thinking of Effie", 50,50);
}
else if (!isFemale && !inCapital && !isDrunk && isTribute){
text("You were thinking of Peta", 50,50);
}
else if (!isFemale && !inCapital && isDrunk && isTribute){
text("You were thinking of Hamish", 50,50);
}
else if (!isFemale && inCapital && !isDrunk && !isTribute){
text("You were thinking of President Snow", 50,50);
}
}//end guess
Class 27 - Tuesday, Oct. 11
Day 4 of Structured Programming 2
Prep: Get the sample code for the quiz example
Formally Announce Binary and Logic Test on Friday
Boolean Kahoot #1
int a = 10; int b = 20; int c = 30;
int d = 40; String name1= “Bob”; String name2 = “Suzie”;
boolean likesCheese = true;
Entering Numbers Review (discussion only)
Walk them through the HigherNumbers example as they need help figuring out how the enter key works.
Work on assignments 1 and 2
Class 26 - Friday, Oct. 7
Day 3 of Structured Programming 2
Prep: Get the sample code for the quiz example
Fire Drill near end of class
Logic Gates Continued
Logic Lab Car
Next year, push this part of entering text back until after the Quiz/Casino assignment. There is a start file on the S: Drive - Text Input - see the sample code below and/or the Inputting Text Google Doc
Finish Assignment 2.1 and Start 2.2 Number Guess Game
Inputting Text
Note that this assumes the code for the Multi Digit Number entry has already been set up. This code therefore builds off that example.
String answer = "";
void setup(){
size(500,500);
}//end setup
void draw(){
fill(0);
rect(25,25,400,75);
fill(255);
text("Wats yo name homie-dawg?", 50,50);
text("Type and then press enter da shizzle.", 50,75);
}//end draw
void keyPressed(){
if(keyCode != SHIFT && key!=ENTER && key!=BACKSPACE ){
answer += key;
}
if(key==ENTER){
background(0);
text("Yo yo yo " + answer + "Welcome to da hood", 50, 200);
}
if(key == BACKSPACE){
answer = answer.substring(0, answer.length()-1);
}
println("Answer: " + answer);
}//end keyPressed
Class 25 - Thursday, Oct. 6
Day 2 of Structured Programming 2
Prep: Get the sample code for the quiz example
Processing Lesson - Entering Single Digit Numbers
Entering Multi-Digit Numbers
Mark Assignment 7 Drawing Program
Assignment 2.1 - Intro to Boolean Logic Square Move
Entering Numbers Version 1 - Single Digits Only
int random1;
int random2;
int score = 0;
void setup(){
size(500,300);
background(0,0,100);
random1 = (int)random(5);
random2 = (int)random(5);
}//end setup
void draw(){
textSize(14);
text("What is " + random1 + " + " + random2, 50,50);
}//end draw
void keyPressed(){
background(0,0,100);
int correctAnswer = random1 + random2;
if ( key-48 == correctAnswer){
text("That is correct", 50,100);
score++;
} else {
text("You ain't good at math.", 50,100);
score = 0;
}
if (score > 9){
text("Congratulations! You passed math.", 50, 150);
}
random1 = (int)random(5);
random2 = (int)random(5);
}//end keyPressed
Entering Numbers Version 2 - Multiple Digits
String inputText = "";
int inputNum;
int random1;
int random2;
int score = 0;
void setup() {
size(500, 300);
background(0, 0, 100);
random1 = (int)random(50);
random2 = (int)random(500);
}//end setup
void draw() {
textSize(14);
text("What is " + random1 + " + " + random2, 50, 50);
}//end draw
void keyPressed() {
background(0, 0, 100);
if (key != ENTER) {
inputText+=key;
}
if (key == ENTER) {
inputNum = Integer.parseInt(inputText);
inputText = "";
int correctAnswer = random1 + random2;
if ( inputNum == correctAnswer) {
text("That is correct", 50, 100);
score++;
} else {
text("You ain't good at math.", 50, 100);
score = 0;
}
random1 = (int)random(50);
random2 = (int)random(50);
}//end ENTER
if (score > 9) {
text("Congratulations! You passed math.", 50, 150);
}
println("InputText is: " + inputText);
}//end keyPressed
Class 24 - Wednesday, Oct. 5
Add a logic quiz/test somewhere in this credit. It is NEEDED to differentiate.
Introduce Structured Programming 2
Walk through If/Else and then If/ElseIf/Else on paper including all the operators
Review If Statements using a Keypress function
Processing Lesson - Entering Numbers
Color Picker Sample Code
void draw() {
}
void keyPressed() {
if (key == 'b' || key == 'B') {
background(0,0,255);
text(“This is blue”, 50,50);
} else if ( (key == 'r' || key == 'R'){
background(255,0,0);
} else{
background(0,255,0);
}
Example 1
if ( age!=15.5 ) {
Stand up
}
Example 2
if ( grade<11 ) {
Hands up
} else {
Hands on head
}
Example 3
if ( grade<13 ) {
Hands on head
} else if ( grade<12 ){
Hands up
} else {
Stand up
}
Example 4
if ( grade<13 ) {
Hands on head
}
if ( grade<12 ){
Hands up
}
Class 23 - Tuesday, Oct. 4
Test - see notes on test for next year
Class 22 - Monday, Oct. 3
Prep - photocopy test
Review requirements for tomorrow’s test
Assignment 7 Drawing Program
Class 21 - Friday, Sept. 30
Prep: Find a video for Transistors -
Create a cheat sheet for the test which will be on Tuesday. This will serve as a sort of final exam for the first credit.
Introduce Binary and how it represents Data Flow
Discuss how binary can represent two things
Create a computing Science dictionary and add Binary Terms to dictionary, copying and pasting from the Internet where appropriate
Introduction to Logic Gates
Introduce the Truth Table on paper
Logic Gates #1 - Google Doc
Logic Lab Lesson 1
Next Week
They did not do the circuits part of Logic #1
Discuss Moore’s Law
Class 20 - Thursday, Sept. 29
Add the bouncing cloud code to yesterday’s Sun/Moong
Creating a Slide Show
Super tough challenge for those that are done all their work:
Last Work time
Class 19 - Wednesday, Sept. 28
Sun/Moon Version 2 example
Work time
Challenges for those done early:
//global variables
int sky = 255;
PImage pic1;
PImage pic2;
PImage pic3;
PImage cloudPic;
int cloudX = 400;
void setup() {
size(500, 600);
pic1= loadImage("house.png");
pic2= loadImage("sun.gif");
pic3= loadImage("moon.png");
cloudPic = loadImage("cloud.png");
}
void draw() {
sky = mouseX/2;
background(sky);
tint(sky);
image(pic1, 100, 295, 300, 300);
noTint();
line(250, 0, 250, 600);
if ( mouseX>250 ) {
image(pic2, mouseX, 100, 100, 100);
} else {
image(pic3, mouseX, 100, 100, 100);
}
image(cloudPic, cloudX, 10, 100, 60);
cloudX--;
if(cloudX < -100){
cloudX = 500;
}
}//end draw
Class 18 - Tuesday, September 27
Prep -
Pythagoras example
Mark Collector Card
Work time
Pythagorus example in preparation for Assign 6
//Global Variables
int widthX = 200;
void setup(){
size(500,500);
}
void draw(){
background(0);
widthX = mouseX;
stroke(255,255,0);
strokeWeight(4);
line(50,50,50,300);
line(50,300,widthX,300);
line(50,50,widthX,300);
}//end draw
Class 17 - Monday, September 24
Prep -
Fix this code Example
Quick challenge/demo of working with switching variables
String block1 = “Science”;
String block2 = “Math”;
text(“Current Block 1 class: “ + block1, 50,50);
text(“Current Block 2 class: “ + block2, 50,70);
Void keyPressed(){
//experiment with what goes here to make the class switch work
//you are not allowed to retype the word Math or Science
//reprint to see if the trade works
println(“New Block 1 class: “ + block1);
println(“New Block 2 class: “ + block2);
}
Go over the specific instructions and layout of the next two assignments
Work Time
Class 16 - Friday, September 23
Prep -
Processing and Number keys
It’s Time to Learn Binary
Work Time
Class 15 - Thursday, September 22
Prep - alter an old example for the Fix This Code activity
New and improved data types activity
E-Commerce Example
Continue Collector Card continues
Augmented Reality Continues
At some point add a computer math quiz separate from the programming quiz.
E Commerce Variables Example
//Global Variables
String product1 = "Fender Stratocaster";
float price1 = 699.00;
int bought1 = 0;
String product2 = "Marshall Amp";
float price2 = 1200.15;
int bought2 = 0;
String product3 = "Strings";
float price3 = 17.95;
int bought3 = 0;
float total1, total2, total3;
float grandtotal;
void setup(){
size(700,400);
background(0);
}//end setup
void draw(){
fill(0);
rect(40,40,400,100);
fill(255);
text(product1, 50,50);
text(product2, 50,65);
text(product3, 50,80);
text("$" + price1, 250,50);
text("$" + price2, 250,65);
text("$" + price3, 250,80);
text(bought1, 350,50);
text(bought2, 350,65);
text(bought3, 350,80);
text("How many do you want to buy?", 50, 350);
}//end draw
void keyPressed(){
bought1 = key-48;
bought2 = key-48;
bought3 = key-48;
total1 = bought1*price1;
total2 = bought2*price2;
total3 = bought3*price3;
grandtotal = total1 + total2 + total3;
text("Your total is $" + (grandtotal *1.05), 50,300 );
}//end keyPressed
Class 14 - Wednesday, September 21
Prep: test the new timer to see if it works, create Bomby start file with pictures and functions set up
Bomb Dropping Example - More with keyPressed and mousePressed
Continue Collector Card continues
Bomby Example - Pictures and Keypresses
int bomby = 10;
String name = "Mr. Couprie";
PImage pic1;
PImage pic2;
Float timer;
void setup() {
size(200, 600);
pic1= loadImage("explosion.jpg");
//pic2= loadImage("bomb.jpg");
}
void draw() {
background(255, 0, 0);
fill(255, 255, 0);
noStroke();
rect(40, bomby, 20, 20);
//image(pic2, 40, bomby, 20,20);
bomby++;
if (bomby > 600) {
image(pic1, 0, 500, 100, 100);
text("You survived for " + timer + "seconds", 20, 100);
} else {
fill(0);
text(name + " your bomb is at " + bomby, 10, 100);
fill(255);
timer = millis()/1000.0; //note the decimal is needed
}
}
void keyPressed() {
bomby = bomby - 5;
}
void mousePressed() {
bomby = 10;
}
Class 13 - Tuesday, September 20
Prep: Make images and fonts step by step notes in the example file
Review Fonts and Pictures with a simple Birthday Card example
Finish Assignment 1 & Introduce Assignment 2 Collector Card
At some point, show this 11 minute Ted.com video about Augmented Reality.
Then follow it up with either of the 2ish minute videos on the home page of this site:
Extra Activity
Class 12 - Monday, September 19
Prep: Copy Scratch marking sheet, curling meeting in announcements
Mark Scratch
Intro to Images
Introduce Fonts
Harper Skull Example
Finish Assignment 1 & Introduce Assignment 2 Collector Card
Please change the following settings. It will be important for future projects.
Class 11 - Friday, September 16
Talk to James Hughes about his level of programming knowledge. He identified as ‘lots’.
Eve, Paul and Josh were away yesterday. Eve both days of processing.
Emerging Technology Videos: Nanotechnology:
Processing Lesson 3 More Shapes
Processing Ex3 - Errors and Using Println
println( "Below are some Processing experiments" );
println( "error" );
println( "2012 - 15" );
println( 2012 - 15 );
println( "I will now try to predict your birth year:" + (2012-15) );
void mousePressed(){
println(“ Mouse - X: “ + mouseX);
}
Intro to Images
Processing Assignment 1
Class 10 - Thursday, September 15
Talk to James Hughes about his level of programming knowledge. He identified as ‘lots’.
Emerging Technology Videos: Nanotechnology:
Processing Ex2Shapes
Finish Scratch
Ex2 Shapes
Start with the two shapes and compare the way they treat X and Y. Then start to add the fill, stroke and strokeweight code.
void setup(){
size(500,400);
background(200,0,200);
}
void draw(){
background(200,0,200);
fill(255,255,0);
stroke (255,0,0);
strokeWeight(25);
rect(250,200,150,100);
fill(0,255,0);
stroke (255,0,0);
strokeWeight(5);
ellipse(250,200,50,70);
line(50,50,mouseX, mouseY);
//stroke(random(255),random(255),random(255));
//ellipse(mouseX,mouseY,50,70);
}
Class 9 - Wednesday, September 14
Emerging Technology Videos: Nanotechnology:
Intro to Programming with Processing
Introduce Processing by comparing the console to the display window with the println() statement
Intro to the Display Window
Complete Ex1Text
Worktime on History and Scratch
Ex1Text
After hardcoding the text line, add and discuss the location variable
int location = 10;
void setup(){
size(500,200);
background(60,150,40);
}
void draw(){
background(60,150,40);
text("Robotics Club Today", location,100);
//location++;
location = location + 2;
if( location > 500 ){
location = -100;
}
}
Class 8 - Tuesday, September 13
Assembly for ¾ of the class
Try to Finish History of Tech
Class 7 - Monday, September 12
Emerging Technology Videos: Nanotechnology:
Introduce History Part 2
Scratch Assignment day 4
Class 6 - Friday, September 9
30 minutes on History
Scratch Assignment day 3
Class 5 - Thursday, September 8
Begin History of Tech
Work for 30 minutes, with a minimum of 2 steps getting completed
Work on Scratch
Class 4 - Wednesday, September 7
Give paper copies of letters to the following without parent email:
Out of date emails for:
Computing Science History Contest
Introduce the History of Tech Presentation
Scratch Lesson - Explore the Other Options
Begin Scratch Assignment 1
Tomorrow - set up sharing in Drive
Class 3 - Tuesday, September 6
Prep: Upload old Scratch examples
Give paper copies of letters to the following without parent email:
Out of date emails for:
What the world will look like with driverless cars
Discuss Embedded Processors and Driverless Cars
Driverless Cars Facts
But you have to be Google or Tesla right? Guess again
Scratch Lesson 2 - Variables and If Statements (Pen continued)
So You Think You Can Dance example
Class 2 - Friday, September 2
Survey Results
What is Computer Science (2:30) - https://www.youtube.com/watch?v=J14DZ0J5O5k
Create a ‘how does/can CS affect your passion visual’ Eg. CS and Theatre Tech
Computing Science scavenger hunt (on Google Docs)
Debrief Scavenger Hunt
How does a programming language work
Scratch Lesson 1 - Pen tool experiments
Next up
Pen Examples 1 - with a variable
Class 1 - Thursday, Sept. 1
Materials/Preparation:
Welcome and Introductions
Go over course outline and overall course schedule
Introduction to Computing Science
Students login to network
Intro to Web Programming - Talk Like a Pirate Assignment
function go(english, pirate){
document.PirateForm.EOutput.value += english;
document. PirateForm.Output.value += pirate;
Intro to Processing - AA Adventure Game
Extra Activities
Welcome to Computer Science 10
You may sit where you like today
I am Mr. Couprie
Semester Plan
SP1 final grade based on: (co-constructed?)
SP2
Week | |
1 (6 classes) Sept.1 - 9 | CS1 - History of Tech SP1 - Scratch |
2 Sept. 12 - 16 | SP1 - Processing |
3 Sept.19 - 23 | SP1 - Processing (plus Friday CSTheory - binary) |
4 Sept. 26 - 30 | SP1 - Processing (plus Friday CSTheory - binary review, transistors, bus and data flow, intro to logic gates) |
5 Oct. 3 - 7 | SP2 (plus Friday CSTheory - parts of the CPU, logic gates car ) |
6 (4 classes) Oct. 11-14 | SP2 (plus Friday CSTheory -) |
7 Oct. 17-21 | SP2 (plus Friday CSTheory -) |
8 Oct. 24 - 29 | SP2 and CS1 |
9 Oct. 31 - Nov. 4 | CS1 |
10 (3 classes) Nov. 7-9 | CS1and Game Maker
Client Side |
11 (3 classes) Nov. 16-18 | Client Side |
12 | Client Side Project - Game Maker intro for all |
13 | Project - AP students to learn Java perhaps with the Horstmann MOOC on UDACITY |
14-16 | Project |
New Processing Resources
Videos of advanced concepts - https://www.youtube.com/user/jomasanrec/videos?sort=da&view=u
Videos and activities of more more basic stuff http://funprogramming.org/