LAST DAY

 

Internet Safety Unit for MS or Elementary Students?

FBLA EVENTS:

3D Animation

Coding & Programming

Mobile App Development

Computer Game & Simulation

Website Design

LESSON 1

Goal: Before you leave class today you will be introduced to CodeHS and how Karel the Dog can be given a set of instructions to perform a simple task.

  1. Sign up for www.codehs.com. HERE IS HOW:
    1. Go to: codehs.com
    2. Class code: AD980
    3. If prompted, use your school Google account to sign in
    4. Acclimate yourself! Look around!
  2. Complete the CodeHS Pretest/Survey–get it from your teacher
  3. Complete the JavaScript Knowledge & Skills Pretest–get it from your teacher
  4. Log into CodeHS and do Lesson 1
    1. Get the Meet Karel the Dog handout from your teacher
    2. Watch 1.1.1 Introduction to Programming With Karel
    3. Do:  1.1.3 Our First Karel Program–change it up a little to experiment!
    4. Do:  1.1.4 Your First Karel Program–show me when you are done
    5. Do: 1.1.5 Short Stack–show me when you are done
    6. If time permits: discover what else Karel can do by checking out the Cheat Sheet.
  5. FYI: CodeHS Online Textbook–use this as a resource
  6. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily): What can Karel teach us about computing?

LESSON 2

GOAL: You will learn about Karel’s ‘World’ and the ways that Karel can interact with it.

VOCAB:

Term Definition
lowerCamelCase lowerCamelCase is a naming convention where the first letter is lower case, and each subsequent start of a word is upper case.
World A “world” or “Karel World” is a grid that karel lives in.
Karel Karel is a dog who listens to your commands.
Command A command is an instruction you can give to Karel.

DO THIS IN ORDER:

  1. REVIEW:
    1. Get the Karel Commands handout from your teacher and complete it–raise your hand when you are done
    2. Do this online quiz:  1.1.2 Quiz: Karel Commands
  2. Watch:  1.2.1 More Basic Karel
  3. Do:  1.2.3 Tennis Ball Square–experiment with it!
  4. Do:  1.2.4 Make a Tower–show me when you are done
  5. Do:  1.2.5 Pyramid of Karel–show me when you are done
  6. If time permits: discover what else Karel can do by checking out the Cheat Sheet.
  7. FYI: CodeHS Online Textbook–use this as a resource
  8. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. How can we make Karel turn right, even though Karel doesn’t know a turn right command?
    2. What is a street in Karel’s world?
    3. What is an avenue in Karel’s world?
    4. What are the directions Karel can face?

LESSON 3

GOAL: Karel can learn new words or commands through the use of functions. This is called defining a functions. Defining functions has syntax rules.

VOCAB:

Term Definition
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:Do:  1.2.2 More Basic Karel Quiz
  2. WATCH:  1.3.1 Karel Can’t Turn Right
  3. Do:  1.3.3 Tower and Turn Right–experiment!
  4. Do:  1.3.4 Slide Karel–show me
  5. Do:  1.3.5 Fireman Karel
  6. Did you get it?!  1.3.6 Karel Turns Right Badge
  7. If time permits: Rewrite previous exercises using functions.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What are functions?
    2. Why are functions useful?
    3. Write out a function for an everyday activity that you perform, for example:
      function eatSandwich(){bring sandwich to mouth;bite down;chew;}

LESSON 4

GOAL: Functions are used to teach Karel a word or command. Using functions allow us to break down our program into smaller pieces and make it easier to understand.

VOCAB:

Term Definition
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.
Curly Bracket An open curly bracket is { and a close curly bracket is }
Function body The part of a function that contains the commands

DO THE FOLLOWING IN THIS ORDER:

  1. REVIEW:
    1. Get the Karel Can’t Turn Right handout from your teacher & complete it–show me before moving on
    2. Get the What’s Wrong with This Function? handout from your teacher & complete it–show me before moving on
    3. Do:  1.3.2 Karel Can’t Turn Right Quiz
  2. Do the Dancing with Functions class activity–get the handout from your teacher
  3. Watch:  1.4.1 Functions in Karel
  4. Do & experiment:  1.4.3 Turn Around
  5. Do & show me:  1.4.4 Pancakes
  6. Do & show me:  1.4.5 Mario Karel
  7. If time permits: Create an original Sandbox program that defines and calls a minimum of 4 (four) functions.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. Why are functions important?
    2. How do functions change how we think about our programs?

LESSON 4–FINISH

  1. Dancing with Functions
  2. Finish & Show me 1.4.4 & 1.4.5

LESSON 5

GOAL: You will gain a deeper understanding of functions. You will be able to explain the importance of writing readable code, and you will be able to analyze and compare the readability of different programs. You will be able to use the start function to make your programs more readable.

VOCAB:

Term Definition
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.
Start Function This is the function that is called when you click run.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Get the Naming Functions handout from your teacher & complete it–show me before continuing
    2. Get the What’s Wrong with the Functions? handout from your teacher & complete it–show me before continuing
    3. Do:  1.4.2 Functions in Karel Quiz
  2. Watch:  1.5.1 The Start Function
  3. What did you notice about the format and syntax of calling functions?
  4. Do & experiment:  1.5.3 Tower with Start Function
  5. Do & show me:  1.5.4 Pancakes with Start
  6. You are going to create your own Karel program using the Sandbox feature. Its important that before you edit Karel worlds that you have an objective for what you would like Karel to do. Write out what the objective is first, then develop a solution for it in your Word Online file for this class.
  7. Create a new Karel program using the Sandbox feature:
    1. Click on the Sandbox tab.
    2. Let’s create a new Karel program together by naming it MyFirstKarelProgram and choosing KAREL for the type of program.
    3. Click on Edit Karel Worlds and try to:
      • Move Karel’s start row and column
      • Changing the width and height
      • Changing Karel’s start direction
      • Adding and Removing a Ball
      • Adding and Removing a Wall
      • Moving Karel
  8. Extra Credit Opportunities:
    1. Create a poster that lists the rules or Do/Don’ts for defining and calling functions.
    2. My Day in Functions–Think about your typical school day. What are the functions that you routinely perform that can be defined like a function? Write out what your day looks like by writing at least 3 functions and calling them throughout your day.Examplefunction start(){snapChat();takeNotes();}function snapChat(){openApp();takePhoto();send();}function takeNotes(){takeOutPaper();writeVocabWords();}

LESSON 6

GOAL: Students will be able to…

  1. Break a large problem down into smaller pieces
  2. Write methods to solve each smaller problem
  3. Solve a complicated problem using Top Down Design
  4. Identify good and poor decomposition

VOCAB:

  1. Break Down (Decompose)–Breaking down (decomposing) your code is splitting it into more functions.
  2. Read Like a Story–Programs that “Read like a story” have good decomposition and make the code easy to follow.
  3. Indentation–Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.
  4. Decomposition–Decomposition is breaking your program into smaller parts.
  5. Top Down Design–Top down design is a method for breaking our program down into smaller parts.

DO THE FOLLOWING IN THIS ORDER:

  1. REVIEW: 1.5.2 The Start Function Quiz
  2. Do the Decomposition Activity–Get the handout from your teacher
    1. Write the instructions for making a peanut butter and jelly sandwich
    2. Using a student volunteer, execute student instructions to make a sandwich as a computer would. Did it work the way you thought it would?
    3. You are not allowed to interpret what the instructions mean, only to execute the instructions literally.
  3. Watch: 1.6.1 Top Down Design and Decomposition in Karel
  4. Using the graphic organizer shown in the video, break down or decompose the process of making a PB & J. Notice how the process can be broken down into functions such as putIngredientOnKnife() or spreadTheIngredients().
  5. 1.6.3 Hurdle Karel
    1. Look at the example of exercise Hurdle Karel. Without running the program, predict what Karel will do and write the pseudocode:  1.6.3 Hurdle Karel
    2. Write your pseudocode on the board so that the class may follow it as the example is run.
    3. Run Hurdle Karel and compare your pseudocode to the actual result of the program. 1.6.3 Hurdle Karel
    4. What did you notice?
  6. 1.6.4 The Two Towers
    1. Notice the starting world and the result world of Karel.
    2. Identify the objective, the preconditions, postconditions.
    3. It might be helpful to move Karel to avenue (2, 1) so that you can see where Karel will begin when she begins to build the Tower.
    4. Once Karel is moved to (2, 1), write the first commands for the buildTower() function.
    5. Be sure to use good style in writing functions by indenting code and using proper syntax.
    6. Before getting with a partner to build the start function, you will need two helper functions.
    7. Once the buildTower() function is built as a class, break into pairs and begin to build the start function.
  7. If time permits:
    1. Decompose more complicated tasks from your every day life
    2. Decompose the same problem into multiple solutions with various levels of granularity
      1. For example, Making a PB&J could have the following answers
        1. Take bread and PB out of cabinet, take Jelly out of fridge, combine ingredients into sandwich
        2. Raise arm, Grasp cabinet handle, Pull handle to open door, etc… (this is probably more granular than you would like, but hopefully you understand the idea!)
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING (respond to just 2 out of the following 7 questions) in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What did you learn in this lesson/day?
    2. How did you learn it?
    3. What was your “a-ha!” moment? What sparked it?
    4. When did you get stuck? How did you get “unstuck”?
    5. Why is it useful to be able to break down problems into smaller sub problems?
    6. Is this strategy only useful for programming? What other situations might we apply this method of problem solving to?
    7. Describe how you helped Karel break down a big problem into a smaller problem today. How did that affect how you wrote your code?

LESSON 7

GOAL: Students will be able to…

  1. Explain the preconditions and postconditions of a function
  2. Create clear and readable comments in their code that help the reader understand the code
  3. Explain the purpose of comments
VOCAB: 
  1. Programming Style–The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
  2. Comment–A message in your code that explains what is going on.
  3. Precondition–Assumptions we make about what must be true before the function is called.
  4. PostconditionWhat should be true after the function is called

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do:  1.6.2 Top Down Design and Decomposition Quiz
    2. Do the Planning Programs 1 activity–get it from your teacher–work with a partner
  2. Click on example  1.7.3 Hurdle Karel. Read the code in green. What purpose do you think the code serves in the program? Does the code in green affect the program?
    1. Can you identify the direction and avenue that Karel faces in the starting world? This is known is as a precondition.
    2. Can you identify the direction and avenue that Karel faces in the result world? Also note the amount of balls in the tower and how many were built. This is known is as a postcondition.
    3. Complete The Two Towers + Comments exercise in pairs or individually.
    4. Because of your hard work with defining and calling functions, you have unlocked the super powers of Karel. These super powers are the ability to turn right and turn around without having to define it as a separate function.
    5. Examine the example in Hurdle Karel (with SuperKarel).
      *Students complete The Two Towers + Super Karel using the turnRight() command.
  3. If time permits: Go back through previous Karel exercises and add pre and postconditions to your code
  4. FYI: CodeHS Online Textbook–use this as a resource
  5. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What are the two types of comments?
    2. What is the benefit of using comments?
    3. Are there times you wouldn’t write a comment? Why?

LESSON 8

GOAL: Students will be able to…

  1. Write programs that use SuperKarel instead of Karel
  2. Utilize the new toolbox of commands that SuperKarel provides over Karel
  3. Read documentation to understand how to use a library (SuperKarel is an example of this)

VOCAB:

SuperKarel SuperKarel is like Karel but already knows how to turnRight() and turnAround()

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.7.2 Commenting Your Code Quiz
    2. Do the Commenting Code activity–get the handout from your teacher
  2. Click on example  1.8.3 Hurdle Karel (with SuperKarel). Read the code in green. What purpose do you think the code serves in the program? Does the code in green affect the program?
  3. Watch 1.8.1 Super Karel video
  4. Do 1.8.4 The Two Towers + SuperKarel & show me
  5.  1.8.5 Super Karel Badge Did you get it?!
  6. If time permits: Go back through previous Karel exercises and add pre and postconditions to your code
  7. FYI: CodeHS Online Textbook–use this as a resource
  8. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. How is SuperKarel different from Karel?
    2. Where can you go to read about all of SuperKarel’s built in commands?

LESSON 9

GOAL: Students will be able to…

  1. Create for loops to repeat code a fixed number of times
  2. Explain when a for loop would be a useful tool
  3. Utilize for loops to write programs that would be difficult / impossible without loops

VOCAB:

  1. Loop–A loop is a way to repeat code in your program.
  2. For Loop–A for loop lets us repeat code a fixed number of times.
  3. Control Structure–A control structure lets us change the flow of the code.
  4. Curly Bracket–An open curly bracket is { and a close curly bracket is }
  5. Parentheses–( and )

DO THE FOLLOWING IN ORDER:

  1. REVIEW: 1.8.2 Super Karel Quiz
  2. Think about this: create a function that will enable Karel to climb one stair. What if Karel needed to climb 100 stairs? What part of your code would you need to repeat? What part of you code will be repeated? How many times will the code be repeated?
  3. Watch  1.9.1 For Loops
  4. Look over  1.9.3 Repeated Move
    1. Notice how the condition inside the parentheses works by stating that:
      1. The variable i is initialized, or started at the value of 0.
      2. The i < 9 determines the point that the loop will stop.
      3. i++ increments, or increases the value of i.
      4. All parts in the condition within the parentheses are separated by a semi-colon, expect the last statement
  5. Run 1.9.3 Repeated Move and  1.9.4 Put Down Tennis Balls example and note how the value of i at the bottom of the screen increases and keeps track of how many times Karel has looped through the statement.
    1. Experiment with the code by changing the value of i.
  6. Do  1.9.5 Take ’em All
  7. Do  1.9.6 Dizzy Karel
  8. Do  1.9.7 For Loop Square
  9. Do  1.9.8 Lots of Hurdles
  10. If time permits: In the example exercises Repeated Move & Put Down Tennis Balls, write functions using for loops
  11. FYI: CodeHS Online Textbook–use this as a resource
  12. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. For loops are a part of all programming languages, why do you think that is?
    2. Why are for loops useful?
    3. For loops extend the limits of what we can do with our programs. What is one Karel program you could write with a for loop that you couldn’t do without one?
    4. Think of and write down three real-life scenarios that could use a for loop.
    5. What did you learn in this lesson/day? How did you learn it? What was your “a-ha!” moment? What sparked it?When did you get stuck? How did you get “unstuck”?

LESSON 10

GOAL: Students will be able to…

  1. Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
  2. Create if statements to only execute code if a certain condition is true

VOCAB: 

  1. ConditionA condition is code that you put inside an if statement or while-loop.
  2. If Statement–An if statement lets you ask a question to the program and only run code if the answer is true.
  3. Control Structure–A control structure lets us change the flow of the code.
  4. Parentheses–( and )

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.9.2 For Loops Quiz
    2. Complete the For Loops handout individually or in pairs.
  2. What determines what time you will go to bed? What determines when you will ask for help in class? What determines when you eat birthday cake? Point out the condition in each of the If statements on the board. Identify what code is executed if the condition is true.
  3. Watch  1.10.1 If Statements
  4. Look at  1.10.3 If Statements by comparing and contrasting what occurs to Karel when the start function is initialized.
    1. Why do you think Karel crashed when the start function is initialized?
  5. Examine 1.10.4 Safe Take Ball example in pairs or individually.
  6. Do & show me  1.10.5 Is There a Ball? individually or in pairs.
  7. FYI: CodeHS Online Textbook–use this as a resource
  8. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. Write if statements for real life scenarios. Examples include:
if (zombiesPresent()){
    runAndHide();
}

if (favoriteSongOnPandora()){
    dance();
}

LESSON 11

GOAL: Students will be able to…

  1. Explain the purpose of an If/Else statement
  2. Create If/Else statements to solve new types of problems
  3. Identify when an If/Else statement is appropriate to be used

VOCAB: 

  1. If Statement–An if statement lets you ask a question to the program and only run code if the answer is true.
  2. If Else Statement–Control structure that lets us do either one section of code or another depending on a test.
  3. Control Structure–A control structure lets us change the flow of the code.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.10.2 If Statements Quiz
    2. Complete the To If, Or Not To If handout individually or in pairs.
  2. Do Now: Your best friend and you agree to go to the theater to see the latest action hero movie. When you arrive however, you are saddened to find out that it has sold out. What activity might you do instead? If that activity can’t be done, what else might you and your friend do to have a fun evening?
    1. Record them as an if/else statement with correct syntax.
    2. What did you notice about what you wrote and how the code is executed?
    3. What might your default command be (goHome(), goToBed(), etc)?
  3. Watch 1.11.1 If/Else Statements
  4. Explore  1.11.3 If/Else Statements and 1.11.4 One Ball in Each Spot exercises.
  5. Do & show me 1.11.5 Right Side Up & 1.11.6 Right vs. Left Square individually or in pairs.
  6. FYI: CodeHS Online Textbook–use this as a resource
  7. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
  1. Explain the difference between an if statement and an if/else statement.
  2. Give an example of a problem that Karel would need an if statement to solve
  3. Give an example of a problem that Karel would need an if/else statement to solve
  4. Why are if/else statements useful?
  5. Write out real life scenarios that would involve if/else statements. For example:
if(favoriteSongOnPandora()){
    dance();
} else {
    doHomework();
}

FINISH:

LESSON 11

GOAL: Students will be able to…

  1. Explain the purpose of an If/Else statement
  2. Create If/Else statements to solve new types of problems
  3. Identify when an If/Else statement is appropriate to be used

VOCAB: 

  1. If Statement–An if statement lets you ask a question to the program and only run code if the answer is true.
  2. If Else Statement–Control structure that lets us do either one section of code or another depending on a test.
  3. Control Structure–A control structure lets us change the flow of the code.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.10.2 If Statements Quiz
    2. Complete the To If, Or Not To If handout individually or in pairs.
  2. Do Now: Your best friend and you agree to go to the theater to see the latest action hero movie. When you arrive however, you are saddened to find out that it has sold out. What activity might you do instead? If that activity can’t be done, what else might you and your friend do to have a fun evening?
    1. Record them as an if/else statement with correct syntax.
    2. What did you notice about what you wrote and how the code is executed?
    3. What might your default command be (goHome(), goToBed(), etc)?
  3. Watch 1.11.1 If/Else Statements
  4. Explore  1.11.3 If/Else Statements and 1.11.4 One Ball in Each Spot exercises.
  5. Do & show me 1.11.5 Right Side Up & 1.11.6 Right vs. Left Square individually or in pairs.
  6. FYI: CodeHS Online Textbook–use this as a resource
  7. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
  1. Explain the difference between an if statement and an if/else statement.
  2. Give an example of a problem that Karel would need an if statement to solve
  3. Give an example of a problem that Karel would need an if/else statement to solve
  4. Why are if/else statements useful?
  5. Write out real life scenarios that would involve if/else statements. For example:
if(favoriteSongOnPandora()){
    dance();
} else {
    doHomework();
}

BEGIN:

LESSON 12

GOAL: Students will be able to…

  1. Explain the purpose of a while loop
  2. Create while loops to repeat code while a condition is true
  3. Utilize while loops to solve new types of problems
  4. Test their solutions on different Karel worlds

VOCAB: 

Loop A loop is a way to repeat code in your program.
While Loop Lets us repeat code as long as something is true.
Condition A condition is code that you put inside an if statement or while-loop.
Control Structure A control structure lets us change the flow of the code.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.11.2 If/Else Statements Quiz
    2. What do we know about for loops?
    3. In what situation would for loops not be helpful?
  2. Do Now: Write instructions that will allow me (the teacher) to clap at the same time as walking. Use a conditional statement or for loop if necessary.
    1. Be prepared to share your instructions with the class.
    2. I will execute the commands exactly as they are read.
  3. Introducing the concept of a while loop: we wanted to achieve clapping while we were walking, thus we can use a while loop.
  4. Watch 1.12.1 While Loops in Karel
  5. Get a copy of While loops (student-version) and begin working on the activity.
    1. After you have completed the activity in the handout, how would a for loop would be written for the activity? How reusable would our code be if Karel’s world became a 4×2 world, or a 5×5 world?
      It is important to remember about writing reusable code, so that if Karel’s world changed, how useful would a for loop be if Karel’s world decreased to 4×2 or a 5×5?
  6. 1.12.3 Move to Wall demonstrates this concept by changing Karel’s world from 6×6, to a 8×8 and 10×10.
  7. Go over the Why Use Loops? handout–get it from your teacher.
  8. SHOW ME WHEN YOU ARE DONE: Work individually or in pairs to complete:
    1.  1.12.4 Follow The Yellow Ball Road
    2. 1.12.5 Lay Row of Tennis Balls: Get the Fence Post Handout from your teacher to possibly help you
    3. 1.12.6 Big Tower
  9. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  10. FYI: CodeHS Online Textbook–use this as a resource
  11. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What is the difference between for loops and while loops?
    2. Provide an example of when you would use each loop.

FINISH:

LESSON 12

GOAL: Students will be able to…

  1. Explain the purpose of a while loop
  2. Create while loops to repeat code while a condition is true
  3. Utilize while loops to solve new types of problems
  4. Test their solutions on different Karel worlds

VOCAB: 

Loop A loop is a way to repeat code in your program.
While Loop Lets us repeat code as long as something is true.
Condition A condition is code that you put inside an if statement or while-loop.
Control Structure A control structure lets us change the flow of the code.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.11.2 If/Else Statements Quiz
    2. What do we know about for loops?
    3. In what situation would for loops not be helpful?
  2. Do Now: Write instructions that will allow me (the teacher) to clap at the same time as walking. Use a conditional statement or for loop if necessary.
    1. Be prepared to share your instructions with the class.
    2. I will execute the commands exactly as they are read.
  3. Introducing the concept of a while loop: we wanted to achieve clapping while we were walking, thus we can use a while loop.
  4. Watch 1.12.1 While Loops in Karel
  5. Get a copy of While loops (student-version) and begin working on the activity.
    1. After you have completed the activity in the handout, how would a for loop would be written for the activity? How reusable would our code be if Karel’s world became a 4×2 world, or a 5×5 world?
      It is important to remember about writing reusable code, so that if Karel’s world changed, how useful would a for loop be if Karel’s world decreased to 4×2 or a 5×5?
  6. 1.12.3 Move to Wall demonstrates this concept by changing Karel’s world from 6×6, to a 8×8 and 10×10.
  7. Go over the Why Use Loops? handout–get it from your teacher.
  8. SHOW ME WHEN YOU ARE DONE: Work individually or in pairs to complete:
    1.  1.12.4 Follow The Yellow Ball Road
    2. 1.12.5 Lay Row of Tennis Balls: Get the Fence Post Handout from your teacher to possibly help you
    3. 1.12.6 Big Tower
  9. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  10. FYI: CodeHS Online Textbook–use this as a resource
  11. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What is the difference between for loops and while loops?
    2. Provide an example of when you would use each loop.

LESSON 13

GOAL: Students will be able to…

  1. Identify the different control structures we can use to modify the flow of control through a program
  2. Combine control structures to solve complicated problems
  3. Choose the proper control structure for a given problem

VOCAB:

Control Structure A control structure lets us change the flow of the code.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.12.2 While Loops in Karel Quiz
    2. What are the different ways we have been able to control Karel in the past week?
  2. What are the differences and similarities of the for, if, and while loops?
  3. Examine the Control Structures Flowchart:
  4. Watch 1.13.1 Control Structures Example video
  5. Walk through 1.13.3 Cleanup Karel by exploring what might happen if the last if statement is removed from the program.
  6. Work individually or in pairs to complete  1.13.4 Random Hurdles
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. When would you use each of the different control structures?

LESSON 14

GOAL: Students will be able to…

  1. Analyze a solution to a problem and explain why it works
  2. Use control structures to create general solutions that work on all Karel worlds

VOCAB:

Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Decomposition Decomposition is breaking your program into smaller parts.
Control Structure A control structure lets us change the flow of the code.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.13.2 Control Structures Example Quiz
    2. What are the different ways we have been able to control Karel in the past week?
  2. Do Now: Get it from your teacher
  3. Share answers for the Do Now exercise from students and test their code in the editor of the Move Tennis Ball Stack example.
    1. What are the reasons why a particular control structure was chosen by students?
    2. If a student example contains bugs, inquire solutions from the class and test it together.
    3. Look at the correct solution. Take note that code was tested in increments.
  4. Watch 1.14.1 More Karel Examples and Testing
  5. Explore the 1.14.3 Move Tennis Ball Stack solution as well as the 1.14.4 Climbing Karel example.
  6. Teacher will show you a preview of Tower Builder exercise in the Karel Challenges section.
    1. What control structures you might use and in which order? Record your answer on the white board in the classroom.
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1.  When would you use each of the different control structures?
    2. Explain in your own words how to make Karel solve the Move Tennis Ball Stack problem.
    3. Explain in your own words how to make Karel solve the Climbing Karel problem.

LESSON 15

GOAL: Students will be able to…

  1. Explain why it is important to indent code
  2. Identify proper indentation
  3. Modify a program to have proper indentation
  4. Write programs with proper indentation

VOCAB:

Indentation Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.14.2 Quiz: Which Control Structure?
    2. Which is easier to read: indented code or unindented code?
    3. What are some things we can do in our code to have good programming style?
  2. Do Now: Get it from your teacher–Share your solutions with a partner to compare and contrast the various results.
    1. Think about English rules regarding indentation and new paragraphs.
    2. What purpose does indentation serve in reading and writing?
    3. How do these rules apply to programming?
  3. Watch  1.15.1 How to Indent Your Code
  4. Examine 1.15.3 Dance and Clean Karel. How can you use the gray dotted lines to guide your indentation?
  5. Work individually or in pairs to complete  1.15.4 Diagonal and 1.15.5 Staircase–SHOW ME
  6. 1.15.6 Karel Exercises Badge–Did you get it? SHOW ME
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. How is indentation used in programs? What are the rules for proper indentation?
    2. Why is it important to use proper indentation?
    3. Why is good programming style important?
    4. Write pseudocode for either Diagonal or Staircase using correct indentation.
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What is the first thing you should do when approaching a new Karel challenge?
  2. Why is it important to write out your solution in your own words before starting to code?
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What is pseudocode? How can writing your solution out in pseudocode help you write your program?
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What should you do if you get stuck?
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What are some tools that can help you debug your programs?

Objective

Students will be able to…
* Write a JavaScript program by typing commands with proper syntax in the start function
* Write a program that prints out a message to the user

Activities

These are all the activities included in the lesson.

Activity

3.1.1 Hello World

Video

3.1.2 Hello World Quiz

Quiz SHOW ME

3.1.3 Hello World

Example

3.1.4 Your Name and Hobby

Exercise SHOW ME

Objective

Students will be able to…
* Explain what variables are and what they are used for
* Create their own variables
* Print out the values stored in variables

Activities

These are all the activities included in the lesson.

Activity

3.2.1 Variables

Video

3.2.2 Variables Quiz

Quiz PRINT QUIZPRO

3.2.3 Basic Variables

Example

3.2.4 Apples and Oranges

Exercise REVIEW FOR CLASS

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.


User input is a cornerstone of any interactive program. In this lesson we learn how we can allow the user to input information into our programs. This will make our programs much more interactive and useful.

Objective

Students will be able to…
* Create programs that ask the user for input
* Store user input in variables and print it back to the user
* Choose the proper input function to use depending on the type of information needed

Activities

These are all the activities included in the lesson.

Activity

3.3.1 User Input

Video

3.3.2 User Input Quiz

Quiz PRINT QUIZPRO

3.3.3 Basic User Input

Example

3.3.4 Grocery Store

Exercise REVIEW FOR CLASS

Lesson: 3.4 Basic Math in JavaScript

Section:


Computers are excellent machines for performing mathematical operations. In this lesson we learn about the different mathematical operators we can use to perform mathematical computations, and we create useful programs that compute useful information for the user.

Objective

Students will be able to…
* Describe the different mathematical operators we can use in programs
* Create programs that use basic math to compute useful things
* Create programs that take in user input, do simple computations with the input, and produce useful output

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Lesson: 3.4 Basic Math in JavaScript

Section:


Computers are excellent machines for performing mathematical operations. In this lesson we learn about the different mathematical operators we can use to perform mathematical computations, and we create useful programs that compute useful information for the user.

Objective

Students will be able to…
* Describe the different mathematical operators we can use in programs
* Create programs that use basic math to compute useful things
* Create programs that take in user input, do simple computations with the input, and produce useful output

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Lesson: 3.5 Using Graphics in JavaScript

Section:


The basics of creating graphics objects to a screen relies on setting the type, shape, size, position, and color before on the artist’s canvas before adding to the screen. Using the geometric concepts, and the concept of getWidth() and getHeight(), multiple graphic objects can be created in JavaScript.

Objective

Students will be able to…
* Create graphical JavaScript programs that draw shapes on the canvas
* Locate points on the graphics canvas using (x, y) coordinates

Activities

These are all the activities included in the lesson.

Activity

3.5.1 Graphics

Video

3.5.2 JavaScript Graphics Quiz

Quiz PRINT QUIZPRO

3.5.3 Graphics Hello World

Example

3.5.4 Blue Circle

Example

3.5.5 Red Rectangle

Example

3.5.6 8 Ball

Example

3.5.7 French Flag

Exercise REVIEW FOR CLASS

3.5.8 Snowman

Exercise REVIEW FOR CLASS

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.


Booleans refer to a value that is either true or false. Named after English-born mathematician, philosopher and logician, George Boole, Booleans are used to test whether a condition is true or false.

Objective

Students will be able to…

  • Create boolean variables to represent meaningful yes/no values
  • Print out the value of a boolean variable

Activities

These are all the activities included in the lesson.

Activity

4.1.1 Booleans

Video

4.1.2 Booleans Quiz

Quiz SHOW ME

4.1.3 First Boolean

Example

4.1.4 Do You Have a Dog?

Exercise SHOW ME

Logical operators allow us to connect or modify Boolean expressions. Three logical operators are the !, ||, && characters.
! = NOT
|| = OR
&& = AND
Logical operators can be used in combination.

With these logical operators, we can construct logical statements such as “I go to sleep when I am tired OR it’s after 9pm”, “I wear flip flops when I am outside AND it is NOT raining”

Objective

Students will be able to…
* Describe the meaning and usage of each logical operator: OR (||), AND (&&), and NOT (!)
* Construct logical statements using boolean variables and logical operators

Activities

These are all the activities included in the lesson.

Activity

4.2.1 Logical Operators

Video

4.2.2 Logical Operators Quiz

Quiz SHOW ME

4.2.3 Light Switch

Example

4.2.4 President

Example

4.2.5 Wasting Time

Example

4.2.6 Can You Graduate?

Exercise SHOW ME

4.2.7 School’s Out

Exercise SHOW ME

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.


Comparison operators let us compare two values. Using comparison operators in programming is similar to math in that less than <, greater than >, less than or equal to <=, and greater than or equal to >= are the same. The differences are that operators for equal to are == and not equal are !=. Using comparison operators allows our program to make decisions.

Objective

Students will be able to…
* Explain the meaning of each of the comparison operators (<, <=, >, >=, ==, !=)
* Create programs using the comparison operators to compare values
* Predict the boolean result of comparing two values
* Print out the boolean result of comparing values

Activities

These are all the activities included in the lesson.

Activity

4.3.1 Comparison Operators

Video

4.3.2 Comparison Operators Quiz

Quiz SHOW ME

4.3.3 Voting Age

Example

4.3.4 Grade Range

Example

4.3.5 Rolling Dice

Exercise SHOW ME

4.3.6 All Star

Exercise SHOW ME

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

SEND ME AN EMAIL MESSAGE TODAY TELLING ME THE SCORE ON YOUR QUIZ AND THE EXERCISES YOU WERE ABLE TO COMPLETE.

Lesson: 4.4 If Statements

Section:


JavaScript uses if statements as a way to make decisions and execute specific code. If statements are helpful in writing code that can be used in different situations.

Objective

Students will be able to…
* Explain the purpose of if statements
* Create their own if statements to selective choose which code is executed in their programs

Activities

These are all the activities included in the lesson.

Activity

4.4.1 If Statements

Video

4.4.2 If Statements Quiz

Quiz SHOW ME

4.4.3 Negative Numbers

Example

4.4.4 Great Names

Example

4.4.5 Even and Odd

Example

4.4.6 Secret Password

Example

4.4.7 Teenagers

Exercise SHOW ME

4.4.8 Stop Light

Exercise SHOW ME

4.4.9 Conditionals Badge

Badge

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.5 For Loops in JavaScript

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration

Activities

These are all the activities included in the lesson.

Activity

4.5.1 Basic For Loop

Video

4.5.2 For Loops Quiz

Quiz SHOW ME

4.5.3 For Loop

Example

4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.5 For Loops in JavaScript

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration

Activities

These are all the activities included in the lesson.

Activity

4.5.1 Basic For Loop

Video

4.5.2 For Loops Quiz

Quiz SHOW ME

4.5.3 For Loop

Example

4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.5 For Loops in JavaScript

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration

Activities

These are all the activities included in the lesson.

Activity

4.5.1 Basic For Loop

Video

4.5.2 For Loops Quiz

Quiz SHOW ME

4.5.3 For Loop

Example

4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.6 General For Loops

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Explain the three parts of the for loop (initialization statement, test statement, increment statement)
* Create for loops that iterate differently than the basic for loop structure (ie count by twos or count backwards)

Activities

These are all the activities included in the lesson.

Activity

4.6.1 General For Loop

Video

4.6.2 General For Loop Quiz

Quiz SHOW ME

4.6.3 Countdown

Example

4.6.4 Count By Twos

Example

4.6.5 Count By Sevens

Exercise SHOW ME

4.6.6 Powers of Two

Exercise SHOW ME

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Lesson: 4.7 For Loop Practice

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…

  • Explain the purpose of for loops
  • Create for loops to solve increasingly challenging problems
  • Create nested for loops: for loops inside of for loops

Activities

These are all the activities included in the lesson.

Activity

4.7.1 For Loop Examples

Video

4.7.2 For Loop Examples Quiz

Quiz SHOW ME

4.7.3 For Loop Sum

Example

4.7.4 Better Sum

Exercise SHOW ME

4.7.5 Factorial

Exercise SHOW ME

4.7.6 All Dice Values

Exercise SHOW ME

A randomizer gives a program the appearance of randomly generated number, color or attribute in a program. The Randomizer can be used in conjunction with nextInt(low, high)nextBoolean()nextFloat(low, high), and nextColor(). It can be utilized to make programs more interesting and engaging for users. With this lesson, students will be made to see how randomization can enhance a program and used in combination with various control structures.

Objective

Students will be able to…

  • Explain why random numbers are a useful part of computer programs
  • Create random values in a program
  • Create programs that do something different on each run depending on random values that are generated
  • Utilize the DOCS for the Randomizer class in order to learn how to generate random values

Activities

These are all the activities included in the lesson.

Activity

4.8.1 Random Numbers

Video

4.8.2 Random Numbers Quiz

Quiz SHOW ME

4.8.3 Rolling a Die

Example

4.8.4 Flipping a Coin

Example

4.8.5 Lots of Dice

Exercise SHOW ME

4.8.6 Random Color Square

Exercise SHOW ME

4.8.7 Randomizer Badge

Badge

 


In this lesson students will explore while loops and JavaScript variables. This combines the ideas of creating variables, updating variables throughout a loop, and determining the correct ending condition. Note that the fibonacci problem is a bit tricky, so you may want to discuss the idea of that on the board or projector.

Objective

Students will be able to…

  • Explain the purpose of a while loop
  • Create while loops to repeat code while a condition is true
  • Utilize while loops to solve new types of problems

Activities

These are all the activities included in the lesson.

Activity

4.9.1 While Loops

Video

4.9.2 While Loops Quiz

Quiz SHOW ME

4.9.3 While Loop Countdown

Example

4.9.4 Inventory

Exercise SHOW ME

4.9.5 Fibonacci

Exercise SHOW ME

Lesson: 4.10 Loop and a Half

Section:


A Loop and a Half is a specific way to write a while loop with the condition being true. Inside the loop, you compare to a SENTINEL value to break out of the loop. This structure often allows you to write less code.

Objective

Students will be able to…

  • Explain the how the loop-and-a-half structure is different from a traditional while loop
  • Explain what an infinite loop is
  • Explain what the break statement does
  • Create programs that use the loop-and-a-half structure to repeat code until a SENTINEL is met, causing the program to break out of the loop

Activities

These are all the activities included in the lesson.

Activity

4.10.1 Loop and a Half

Video

4.10.2 Loop and a Half Quiz

Quiz SHOW ME

4.10.3 Adding Up Numbers

Example

4.10.4 Snake Eyes

Exercise SHOW ME

4.10.5 Better Password Prompt

Exercise SHOW ME

4.10.6 Looper Badge

Badge

 

Lesson: 5.1 Functions and Parameters 1

Section:


In this lesson we start to introduce functions and parameters. Functions and parameters are some of the key building blocks for all programs. Here we just introduce functions with parameters, but functions with return values comes next. This way students can just focus on the “input” to the function rather than the input and output at the same time. Students will start writing console programs to try simple functions with parameters and will then write graphics programs.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create their own JavaScript functions
  • Utilize their JavaScript functions to solve simple problems
  • Create functions that take in parameters as input

Activities

These are all the activities included in the lesson.

Activity

5.1.1 Functions and Parameters 1

Video

5.1.2 Functions and Parameters Quiz 1

Quiz SHOW ME

5.1.3 Double Number

Example

5.1.4 Square

Exercise SHOW ME

5.1.5 Triple

Exercise SHOW ME

Lesson: 5.2 Functions and Parameters 2

Section:


Functions and parameters are some of the key building blocks for all programs. Here we just introduce functions with parameters, but functions with return values comes later. This way students can just focus on the “input” to the function rather than the input and output at the same time. Students will start writing console programs to try simple functions with parameters and will then write graphics programs.

This lesson covers functions with multiple parameters. Students will write functions that take in multiple parameters as input and print out output.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create their own JavaScript functions
  • Utilize their JavaScript functions to solve simple problems
  • Create functions that take in multiple parameters as input, and use print statements for output

Activities

These are all the activities included in the lesson.

Activity
5.2.1 Functions and Parameters 2 Video
5.2.2 Functions and Parameters Quiz 2 Quiz SHOW ME
5.2.3 Sum Function Example
5.2.4 Area of Triangle Exercise SHOW ME
5.2.5 Height in Meters Exercise

Lesson: 5.3 Functions and Parameters 3

Section:


Functions and parameters are some of the key building blocks for all programs. Here we just introduce functions with parameters, but functions with return values comes later. This way students can just focus on the “input” to the function rather than the input and output at the same time. Students will start writing console programs to try simple functions with parameters and will then write graphics programs.

This lesson covers functions with multiple parameters that create graphics as output. This is very useful, since creating several different graphical objects involves writing the same code over and over again (set the size, set the color, set the location, etc). Functions and parameters allow us to write the code once and then use parameters to create the different graphical objects and add them to the canvas.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create their own JavaScript functions
  • Utilize their JavaScript functions to simplify their graphics programs
  • Identify repeated code that can be simplified with functions and parameters
  • Create functions that take in multiple parameters as input, and create graphics as output

Activities

These are all the activities included in the lesson.

Activity

5.3.1 Functions and Parameters 3

Video

5.3.2 Functions and Parameters Quiz 3

Quiz SHOW ME

5.3.3 Draw Circles

Example

5.3.4 Horizontal Lines

Exercise SHOW ME

5.3.5 Graphics Stop Light

Exercise SHOW ME

5.3.6 Pool Table

Exercise SHOW ME

5.3.7 Parameters Badge

Badge

Lesson: 5.4 Functions and Return Values 1

Section:


Think of a function like assigning a task. A return value is giving you the completed work.
This allows you to write functions that do some work for you and send back the result.
Parameters are like inputs into the function, and the return value is output.

Objective

Students will be able to…

  • Explain the purpose of returning a value from a function.
  • Create functions that return values.
  • Create programs that call functions with return values and store the result for later use.

Activities

These are all the activities included in the lesson.

Activity

5.4.1 Functions and Return Values 1

Video

5.4.2 Functions and Return Values Quiz

Quiz SHOW ME

5.4.3 Double Number

Example

5.4.4 Square with Return Values

Exercise SHOW ME

5.4.5 Triple with Return Values

Exercise SHOW ME

Lesson: 5.5 Functions and Return Values 2

Section:


Think of a function like assigning a task. A return value is giving you the completed work.
This allows you to write functions that do some work for you and send back the result.
Parameters are like inputs into the function, and the return value is output.

Objective

Students will be able to…

  • Explain the purpose of returning a value from a function.
  • Create functions that return values.
  • Create programs that call functions with return values and use the return values to solve a higher order problem.

Activities

These are all the activities included in the lesson.

Activity

5.5.1 Functions and Return Values 2

Video

5.5.2 Functions and Return Values Quiz 2

Quiz SHOW ME

5.5.3 Return Values

Example

5.5.4 Is It Even?

Exercise SHOW ME

5.5.5 Max

Exercise SHOW ME

Lesson: 5.6 Local Variables and Scope

Section:


In this lesson we explore the scoping of a variable, which is where the variable is “defined” or where it exists. In this unit getting students to define and explain the concept themselves is key.

Objective

Students will be able to…

  • Identify the scope of a variable
  • Identify which variables are in scope at a given point in a program

Activities

These are all the activities included in the lesson.

Activity

5.6.1 Local Variables and Scope

Video

5.6.2 Local Variables and Scope Quiz

Quiz SHOW ME

5.6.3 Return Values

Example

5.6.4 Local Variables

Exercise SHOW ME

5.6.5 JavaScript Exercises Badge

Badge

Lesson: 6.1 Unit Test

Section:


Use your knowledge of basic Javascript to create some fun programs! Students will create their own Ghost drawings from Pac-Man, a Guessing Game, and a drawing of their own choosing. This will allow students to get creative with their code to show what they have learned.

Objective

Students will be able to…

  • Synthesize the skills and concepts from the JavaScript and Graphics, JavaScript Control Structures, and the Functions and Parameters units to solve increasingly difficult programming challenges
  • Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
  • Create helpful comments with preconditions and postconditions to help the reader understand the code
  • Find and fix bugs in large programs

Activities

These are all the activities included in the lesson.

Activity

6.1.1 Ghosts

Challenge SHOW ME

6.1.2 Guessing Game

Challenge SHOW ME

6.1.3 Draw Something

Challenge SHOW ME

6.1.4 Basic JS Unit Quiz

Quiz SHOW ME

6.1.5 JavaScript Challenges Badge

Badge

Lesson: 7.1 Timers

Section:


In this lesson students will be introduced to the concept of using timers for animation. Now instead of having graphics programs that stay the same, the content changes every time the timer runs. The first program students will see is a moving ball, so discussing this with the class as a demo on the projector is very useful.

Objective

Students will be able to…

  • Explain in their own words how animation works
  • Create animation in programs using the setTimer function
  • Explain what a callback function is

Activities

These are all the activities included in the lesson.

Activity

7.1.1 Timers

Video

7.1.2 Timers Quiz

Quiz PRINT QUIZPRO

7.1.3 Moving Ball

Example

7.1.4 Magic 8 Ball

Example

7.1.5 Crazy Ball

Exercise REVIEW FOR CLASS

 Lesson: 7.2 Random Circles

Section:


In this lesson we’ll look at more examples with timers and start making more interesting animations. Students will use timers and the Randomizer to create animations on the canvas.

Objective

Students will be able to…

  • Create programs with timers to create increasingly challenging animations
  • Analyze existing programs and explain how they create animations
  • Utilize the Randomizer to generate random events in their animations

 Lesson: 7.3 Random Ghosts

Section:


In this lesson students now use timers in combination with the other ideas they have learned, including more graphics as well as coordinate math to create different objects. The random ghosts serves as a fun example to show how you can modify things once you have the basic building blocks in place.

Objective

Students will be able to…

  • Explain the general workflow of creating an animation program
  • Analyze animation programs and identify similarities and differences
  • Create increasingly challenging animations using timers, graphics, and the Randomizer

Activities

These are all the activities included in the lesson.

Activity
7.3.1 Example: Random Ghosts Video
7.3.2 Random Ghosts Quiz Quiz PRINT QUIZPRO
7.3.3 Random Ghosts Example
7.3.4 Random Fireworks Example
7.3.5 Circle Wall Exercise REVIEW FOR CLASS

 Lesson: 7.4 Bouncing Ball

Section:


This lesson builds on our use of timers and utilizes if statements inside timers to dynamically change what the animations are doing. The exercises build on the Bouncing Ball example.

Objective

Students will be able to…

  • Explain the general workflow of creating an animation program
  • Analyze animation programs and identify similarities and differences
  • Create increasingly challenging animations using timers, graphics, and the Randomizer

Activities

These are all the activities included in the lesson.

Activity

7.4.1 Example: Bouncing Ball

Video

7.4.2 Bouncing Ball Quiz

Quiz PRINT QUIZPRO

7.4.3 Bouncing Ball

Example

7.4.4 Hotspot Ball

Exercise REVIEW FOR CLASS

7.4.5 Trail

Exercise REVIEW FOR CLASS

7.4.6 Animator Badge

Badge

 Lesson: 7.5 Mouse Events: Mouse Clicked

Section:


Here we introduce a way the students can get input from the mouse using mouse clicked. We keep some of the same building blocks by showing examples with circles and ghosts, and then the student programs prompt them to use this new idea in combination with tracking overall program state.

Objective

Students will be able to…

  • Describe how events are different than timers
  • Use mouse click events to create programs that respond to user clicks

 

Lesson: 7.6 Mouse Events: Mouse Moved

Section:


Mouse events capture actions performed by the mouse. This allows you to create interactive programs including basic games. This lesson explains how to use mouse events to make some interactive animations.

Objective

Students will be able to…

  • Explain how events are different from timers.
  • Create interactive programs that use events to respond to the mouse moving.

Activities

These are all the activities included in the lesson.

Activity

7.6.1 Mouse Events: Mouse Moved

Video

7.6.2 Mouse Events: Mouse Moved Quiz

Quiz PRINT QUIZPRO

7.6.3 Simple Painting

Example

7.6.4 Colorful Drag to Paint

Example

7.6.5 Coordinates

Exercise REVIEW FOR CLASS

7.6.6 Target

Exercise REVIEW FOR CLASS

 

 Lesson: 7.7 Drawing Lines

Section:


In this lesson we continue to use user input via the mouse.

Objective

Students will be able to…

  • Explain how events are different from timers.
  • Create interactive programs that use events to respond to the mouse moving.

Activities

These are all the activities included in the lesson.

Activity

7.7.1 Example: Drawing Lines

Video

7.7.2 Drawing Lines Quiz

Quiz PRINT QUIZPRO

7.7.3 Drawing Lines

Example

7.7.4 Leash

Exercise REVIEW FOR CLASS

7.7.5 Advanced Animator Badge

Badge

 

 Lesson: 7.8 Key Events

Section:


Keyboard events capture when the user presses keys on the keyboard. This allows you to write programs that take input from the keyboard to change what is happening in the program.

Objective

Students will be able to…

  • Explain how events are different from timers.
  • Create interactive programs that use events to respond to the keyboard input.

Activities

These are all the activities included in the lesson.

Activity

7.8.1 Key Events

Video

7.8.2 Key Events Quiz

Quiz PRINT QUIZPRO

7.8.3 Keyboard Square

Example

7.8.4 Basic Snake

Exercise REVIEW FOR CLASS

 Lesson: 7.9 Crazy Ball Game

Section:


In this lesson students will create a drag and drop program by combining lots of the ideas from this section.

Objective

Students will be able to…

  • Synthesize the skills and concepts learned in the Animation and Games unit to create a full game step by step.

 

Lesson: 8.1 Breakout

Section:


Students will learn to make their very own Breakout video game! This lesson brings together everything they have learned in the module and allow them to show it off in a complete game.

Objective

Students will be able to…
* Synthesize the skills and concepts from Java Script Control Structures, Functions and Parameters, and Animation and Games to create their very own Breakout game from scratch!
* Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
* Create helpful comments with preconditions and postconditions to help the reader understand the code
* Find and fix bugs in large programs

Activities

These are all the activities included in the lesson.

CREATE YOUR OWN PROGRAM IN CODEHS.

YOU HAVE TWO CLASSES TO FINISH THIS

INCLUDE THE FOLLOWING:

  • 2 questions
  • base the response from the computer on the answers to the 2 questions
  • include multicolored graphics

 

CREATE YOUR OWN PROGRAM IN CODEHS.

YOU HAVE TODAY TO FINISH THIS–YOU WILL SHOW THE CLASS NEXT TIME

INCLUDE THE FOLLOWING:

  • 2 questions
  • base the response from the computer on the answers to the 2 questions
  • include multicolored graphics

 

FINISH YOUR CODEHS PROGRAM

 

KAREL UNIT EXAM

GOAL: Today you will get acquainted with the Unity Editor. You will be introduced to importing assets, the viewer windows, and how to navigate within the Unity Editor.

DO NOW:

  1. WATCH THIS BEGINNER’S ADVICE VIDEO. It offers 3 pieces of advice:
    1. Keep it simple: Set realistic goals for your first game.
    2. Play to your strengths: Let your game type reflect your talents and resources.
    3. Be persistent: Just seeing your project through will put you ahead of the pack.
  2. Complete the following tutorials, using the Unity Editor:
    1. READ: Learning the Interface Tutorial–http://docs.unity3d.com/Manual/LearningtheInterface.html
    2. WATCH THIS: Unity Interface
  3. Get into Unity on your computer
  4. Under Learn, click on & do 01. Play & Edit Mode, then do 02. Game Objects & Components
  5. In your Word Online file for this class, write about what you learned today.

GOAL: Today you will get acquainted with the Unity Editor. You will be introduced to importing assets, the viewer windows, and how to navigate within the Unity Editor.

DO NOW:

  1. WATCH THIS: The Scene View
  2. Get into Unity on your computer & do the following Basic Tutorials:
    1. 03. Tweaking Components
    2. 04. Prefab Power
  3. Click Tutorial Projects & do: Roll-a-ball–SHOW ME WHEN IT IS DONE
  4. In your Word Online file write about what you learned today and let me know how Unity is working for you.

Roll-a-ball tutorial

Create a simple rolling ball game that teaches you many of the principles of working with Unity.

1. Environment and Player

2. Camera and Play Area

2D GAME KIT

3D GAME KIT 

or continue working on the 2D Game Kit

Roll a ball

2D

3D

We will have a Unity viewing party next class

Roll a ball

2D

3D

UNITY VIEWING PARTY

  1. WATCH THIS: The Game View
  2. WATCH THIS: The Project Window
  3. WATCH THIS: The Hierarchy Window

GOAL: Today you will get acquainted with the Unity Editor. You will be introduced to importing assets, the viewer windows, and how to navigate within the Unity Editor.

  1. Get into Unity:
    1. Type Unity in the lower left of your screen
    2. Click Unity
    3. Choose New Project
    4. Click Create New Project
  2. Editor Basics: http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/editor-basics
    1. Do the video–your screen will look slightly different–that is ok
    2. When saving–go to your ONEDRIVE–create a folder named UnityProjects and save the new file as TwitchProject in the UnityProjects folder
  3. In your Word Online file for this class, write about what you learned today.

GOAL: Create your Game Developers Journal & a Game Modification Task Sheet & Plan

  1. Open & read this: Game Developer’s Journal–You need to do this!!! Here is what you should do for your journal today:
    1. Enter at least 5 core game (i.e. product) ideas to be considered for your final Capstone Project. These do not need to be very detailed ideas, just a few sentences to capture the main game concept. Later, one of these ideas will be developed and delivered as your final Capstone Project submission.
  2. Download CandyCrush Saga onto any game play device. The game can be found at http://candycrushplayfreegame.com
  3. Play the game long enough to understand the directions and the overall objectives of the game.
  4. Produce a Game Modification Task Sheet document by identifying the following:
    1. What platform is used to play the game?
    2. What is the objective of the game?
    3. What three things do you like about the game?
    4. What three things do you not like about the game?
    5. List three reasons why you think this game is popular and successful.
  5. Based on your own observations, create a written plan for modifying the game. This document will  serve as your Game Modification Plan. Your plan should include the following:
    1. Re-write the main goal of the game.
    2. Describe how you would improve the game. Be as specific as possible!
    3. List three reasons why your ideas may not have been implemented by the original designers.
    4. List three reasons why you think players would like your changes.
    5. List three reasons why these changes would be difficult to implement.
    6. Here is how it will be scored

Unit 3–Intro to Programming

Chapter 1: Intro to Programming

Big Questions:

  • Why do we need algorithms?
  • How is designing an algorithm to solve a problem different from other kinds of problem solving?
  • How do you design a solution for a problem so that it is programmable?
  • What does it mean to be a “creative” programmer?
  • How do programmers collaborate?

Lesson 1: The Need for Programming Languages

Objectives: Students will be able to………

  • Assess the clarity of a set of instructions expressed in human language
  • Create a set of instructions in human language for building a simple LEGO block arrangement
  • Identify connections between the ability to program and the ability to solve problems
  • Describe the ambiguities inherent in human language and the ways programming languages seek to remove those ambiguities

DO NOW:

  1. Go to www.code.org
  2. Join my class: http://studio.code.org/join/BQFGGY
  3. Watch this Ted Talk–You Should Learn to Code
  4. Get the Activity Guide–LEGO Instructions
  5. With 5-10 minutes remaing, respond to the following in your Word Online file for this class:
    1. Consider the algorithm you designed for today’s activity. Identify two instances where there may be multiple ways to interpret your instructions and suggest improvements that could be made to improve their clarity.
    2. Describe the features of a programming language that make it different from the language you are used to using in everyday life. Explain why a programming language must be created in this way.

Unit 3–Intro to Programming

Chapter 1: Intro to Programming

Big Questions:

  • Why do we need algorithms?
  • How is designing an algorithm to solve a problem different from other kinds of problem solving?
  • How do you design a solution for a problem so that it is programmable?
  • What does it mean to be a “creative” programmer?
  • How do programmers collaborate?

Lesson 2: The Need for Algorithms

Objectives: Students will be able to………

  • Trace programs written in the “Human Machine Language”
  • Develop an algorithm to find the smallest playing card in a row of cards
  • Express an algorithm in the “Human Machine Language”
  • Identify the properties of sequencing, selection and iteration the “Human Machine Language”
  • Evaluate the correctness of algorithms expressed in the “Human Machine Language”

DO NOW:

  1. Go to www.code.org & log in
  2. Intro
    1. Recall the lessons learned about language. Yesterday’s activity focused on the inherent difficulties of trying to express precise processes with written language. We arrived at a few conclusions…
      1. We need to agree on a set of commands and exactly what terms mean
      2. The fewer commands we have, the easier it is to agree
      3. We want to know what are the “primitive” operations – the most basic set of operations that will allow us to do most of the tasks that the situation requires.
      • Language is important, but there is another part to programming. Once you have a well defined language you need to apply it to problems.
      • The art (and science) of using a well-defined language of primitive operations to solve problems is the art and science of algorithms.
      • The CS Principles definition of algorithm is: Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.
      • One way to think of the study of algorithms is that it is the study of processes — how can you use a small set of instructions to clearly and correctly define process that will solve some problem?
      • Yesterday, with the LEGO blocks, you also attempted to design an algorithm. Any time you are trying to write a precise set of instructions for a process to solve a problem you are designing an algorithm.
      • Today we’re going to get into algorithms a little more deeply.
  3. Activity 1: It goes without saying that in a Computer Science class we are concerned with not just any processes, but computational processes – ones that can be executed by a computer – which have specific sets of constraints. We often get started thinking about algorithms and computational processes by trying to rigorously act them out ourselves as a sort of “Human Machine”. When acting as a machine, we can keep the limitations of a computer in mind. In this activity you’re going to pretend that you are a “Human Machine” that operates on playing cards on the table.
    1. Get the Human Machine Minimum Card Algorithm Activity Guide
    2. Get clear on the task, rules, instructions
    3. With a partner act out an algorithm
    4. Write down the steps
    5. As you are working you might ask yourself questions like:
      • “How do you know when to stop?”
      • “Do your instructions state where and how to start?”
      • “Is it clear where to put cards back down after you’ve picked them up?”
    6. You and your partner share with the class.
    7. As we look at these algorithms you came up with, we can see they are not all the same. However, there are common things that you are all making the human machine do and commonalities in some of your instructions. Can we define a language of common Human Machine commands for moving cards around? What are the commands or actions most of these instructions have in common?
    8. What are some commands?
    9. Write them down or group them based on type.
    10. Here are some examples:
      1. SHIFT (hand) – some form of shifting hands one position down the row left or right
      2. MOVE (hand) – some form of moving a hand directly to a particular card based on its position in the list or to the position of one of the other hands.
      3. COMPARE – some way to compare cards and do something based on the result like: “if card in right hand is less than card in left hand then…”
      4. GO TO LINE – some way to jump to an earlier or later line in the program
      5. PICK CARD UP/PUT CARD DOWN – some way to do this that also makes clear where to put a card back down. Typically something like: “Put right hand card down into the right-most open space in the row of cards”
  4. Activity 2: We have just identified a set of primitive commands that we can use to operate on a set of cards. To be very concrete let’s formalize this into a language. Get the Activity Guide – Human Machine Language – Activity Guide
    1. Read the first page. Be sure you understand the instructions and setup.
    2. Get with the partner you had before
    3. You should try to figure out the example programs with a partner, making use of the code reference guide.
    4. One partner reads, the other acts as the human machine.
    5. You should jot notes about what the program does.
    6. Do you understand how the language works?
    7. Let’s take turns describing each one.
    8. Go to the last problem
      1. Did you understand it?
      2. What would be your solution?
    9. This problem we identified with the last example speaks to the art and science of algorithm design and what can make it so interesting. The question is: can we fix the problem without adding more commands to the language? If we can fix a problem without extending the language, that’s a good thing. We can focus our attention on designing algorithms given these constraints. Let’s try to write FindMin using the Human Machine Language…
      1. First, what’s different about the problem setup for the Human Machine Language?
          1. This might be very challenging at first since the problem setup is slightly different
          2. The problem now has different initial assumptions.
            1. All cards are face up
            2. Card positions have numbers
            3. Don’t need to pick up cards or put them down
            4. There is actually no way to move cards at all – only hands
            5. The ending state is well defined – left hand touching the min card.
      2. Now use the Human Machine Language to write the algorithm for finding the min card.
        1. NOTE: You can just write the code, or you can use the cutout strips of the commands and write values into the boxes.
        2. Work with your partner.
      3. Share solutions to Find Min with the Human Machine Language
        1. You and your partner get together with another group to compare solutions.
        2. Each group should test out the other group’s code by acting as the human machine.
        3. During the comparison note any differences in people’s approach.
      4. It’s okay if you can’t quite finish before the period is over. This activity continues in the next lesson anyway.
  5. This is a first experience in evaluating some code.
  6. It’s important to actually try out a solution to identify any potential errors.
  7. It’s also important to see that people’s programs are different
  8. With 5-10 minutes remaining, respond to the following in your Word Online file for this class:
    1. Connect algorithms to programming.
      1. Yesterday we discussed the need for a programming language. Today we came up with our own programming language and used it to implement an algorithm. The CSP definition of algorithm is: “a precise sequence of instructions for processes that can be executed by a computer and are implemented using programming languages.”
      2. Notice two things about algorithms and programming…
        1. Different algorithms can be developed to solve the same problem–Even though you were all trying to solve the same problem (find min) as a class we came up with different methods for doing it. We would say we came up with different algorithms.
        2. Different code can be written to implement the same algorithm–This is sometimes surprising to newcomers. When writing “code” (even with with the human machine language) two people trying to write code to implement the same algorithm may very easily code it differently.
      3. These two facts – Different algorithms can be developed to solve the same problem and different code can be written to implement the same algorithm – embody art of programming and what makes programming so fun, engaging and creative. In programming, just like art, we strive to make beautiful things:
        1. A beautiful algorithm is an elegant and clever idea for how to solve a problem.
        2. A beautiful program is an elegant use of whatever language structures are provided to make the algorithm actually work on a computer.
  9. Foreshadow: tomorrow we’ll try some other algorithms in the human machine language.

Unit 3, Chapter 1, Lesson 3: Creativity in Algorithms

Objectives

Students will be able to:

  1. Develop an algorithm to solve a new problem with playing cards
  2. Express an algorithm in the Human Machine Language
  3. Identify Sequencing, Selection and Iteration in a program written the Human Machine Language
  4. Describe the properties of the Human Machine Language that make it a “low level” language.

Getting Started

Conclusions from Find Min

  1. Finish FindMin from last class–remember you can use the scissors to cut the commands or your can just write them in pencil
  2. Before moving on to the activity you should all have some solution to FindMin written in the Human Machine Language.

Creativity in Algorithms

  1. One thing about algorithms is that once you know a few, and know how they work, you can combine them (or slightly modify them) to solve new problems. Creativity in algorithms comes from figuring out clever ways to solve problems by developing a process that could be executed by a machine.
  2. We study algorithms and care about them because in programming the techniques and mechanics of certain processes come up over and over and over again. So it’s worth knowing a few so you don’t have to reinvent the wheel.
  3. For example, you just wrote an algorithm to find the smallest card in a row of cards. Is it hard to modify that exact same strategy to find the max card?
  4. Today we’ll challenge you with a few more problems that will require you to get creative!

Activity

Adding SWAP to Human Machine Language

  1. Get the – Human Machine Language – Part 2: Min To Front – Activity Guide from your teacher
  2. Get with a partner
  3. Review the first page of the activity guide and the addition of the “swap” command.
  4. Do the example program
  5. Review the example: Here is the solution–END STATE: the order of the cards has been reversed. It does this by first moving the right hand to the end of the list, then shifting each hand progressively toward the middle of the orw, swapping cards each time. The program stops once the hands have crossed over each other (by checking if RHPos<LHPos)

Challenge: Min-to-Front

  1. The challenge is to find the min card and swap it to the front of the list, keeping the order of the rest of the cards the same.
  2. As you work try to solve the problem in pieces.
  3. Here are some suggestions:
    1. IDEA: Solve move-to-front first
      1. Remember: “Algorithms can be combined to make new algorithms”
      2. You should know a solution to find min, so you can put that out of mind for a minute.
      3. Start by assuming that you’ve found the min card, and writing a procedure to move some card to the front of the list, by swapping.
      4. Once you’ve got that you can tack the two together
    2. IDEA: Don’t be afraid to invent a completely new algorithm
      1. get creative – you might need or want to invent a whole new algorithm

Wrap Up

  1. Learning to program is really learning how to think in terms of algorithms and processes. And it can be really fun and addicting. It also can make you feel like you have magical powers.
  2. In the next lesson we’ll start writing programs that a real machine (not a human machine) will execute. But since programming is really about thinking and problem solving your “human machine” skills will come in handy – reasoning about program is also about reasoning about what a computer can and cannot do, and what the given language you’re using let’s you and doesn’t let you do.
  3. If you didn’t want to learn how to program before, perhaps this video will change your mind… You Should Learn to Program: Christian Genco at TEDxSMU – Video

Unit 3, Chapter 1, Lesson 4: Using Simple Commands

Overview

Students use the App Lab programming environment for the first time and become acquainted with the turtle. The chief problem is to find the most “efficient” way to draw an image of a 3×3 grid using a limited set of only 4 commands.

Objectives

Students will be able to:

  • Use App Lab to write programs that create simple drawings with “turtle graphics.”
  • Create a program with a partner following the pair programming model
  • Explain different ways one might measure the efficiency of a program.

Vocab

  • Pair Programming – A method of programming in which two programmers write code using a single computer. One programmer in the “driver” role uses the mouse and keyboard to actually write the code while a second acts as a “navigator”, keeping track of the big picture, catching errors, and making suggestions. Programmers switch roles frequently and communicate throughout the process.
  • Turtle Programming – a classic method for learning programming with commands to control movement and drawing of an on-screen robot called a “turtle”. The turtle hearkens back to early implementations in which children programmed a physical robot whose dome-like shape was reminiscent of a turtle.

New Code

Getting Started–Transitioning to Programming

  1.  Think back over the human machine language lessons we just completed. In your Word Online file for this class, write down some advice or encouragement you’d give to students in next year’s class before they complete those same lessons. What attitudes or skills will be important?
  2. Share your advice.
  3. SPOILER ALERT: This advice isn’t really for next year’s students, but for all of you! Today we’re going to begin programming on the computer, and while that’s obviously different from the human machine language activities we just completed, a lot will be the same. You’ll need to stick with it, pay attention to detail, and collaborate with others. In fact, before we jump in there’s one new collaboration skill I want to teach you all.
  4. Today we’ll be using a practice called pair programming. Pair progamming helps people make better programs by working together. The main idea is that two programmers use a single computer to collaboratively develop code. There’s a few rules to make sure this system works effectively.
    1. There is only one computer and two programmers.
    2. Assign one student “driver” and the other “navigator”. Don’t worry, you’ll switch often.
    3. The driver is the only one to touch the keyboard/mouse.
    4. The navigator should look for problems in the code and keep track of the high-level plan.
    5. Both driver and navigator should be communicating constantly by talking out loud and sharing ideas.
    6. Driver and navigator roles must switch when the teacher indicates, typically every 3-5 minutes

Activity–Move to App Lab

  1. Get with a partner
  2. To get you situated in App Lab there’s a quick video. Once everyone is through that we’ll get started. I’ll keep track of time and remind you to switch who is driver and navigator every 3 minutes or so. Make sure you’re ready to switch by talking out loud and sharing ideas.
  3. Show me your work in the answer viewer. I will be looking for the following criteria:
    • The program draws the desired figure.
    • The turtle is returned to its starting location and is pointed in the correct direction.
    • The figure is located in the correct position, relative to the starting position of the turtle.
    • The program only makes use of the “building block” commands provided.
    • The program is reasonably efficient in its execution.

Wrap-up–What does “efficiency” mean when programming?

  1. Compare Solutions and Discuss: Each pair of students should get together with another pair to compare their solutions for each of the three problems to determine which is the most efficient. Once they have shared and compared their solutions they can consider the questions below.
  2. In your Word Online file for this class, respond to the following:
    1. What strategies or reasoning did you use to identify possible solutions?
    2. Is the solution that you or another group found the most efficient? How do you know?
    3. What is the “most efficient” way to program the solution for the 3×3 grid?
  3. Share at your tables.
  4. Today’s activity challenged us to find the most efficient solution to a problem. We care about efficiency when we don’t want to waste something valuable, like money, time, or space. We measured the efficiency of our programs in terms of lines of code, but there are other ways to think about efficiency when talking about code or programs that run on a computer. When we try to create efficient programs, what other valuable resources might we be concerned about conserving?

What’s the point? Why constrain to 4 commands

  1. Why did we constrain you to only working with 4 possible commands? We begin programming with only a few commands for a few main reasons:
    1. What you did today is what you always do when programming: use a language to express a solution to a problem. Collaborative problem-solving skills are important factors in programming. Being able to get together with other people to talk about and make reasoned arguments about the best ways to code things is what professionals do.
    2. Learning to program isn’t just a matter of memorizing commands. The art of programming – the creative part – is always about understanding how to use the features of a programming language to solve a problem.
    3. Whether you know 4 commands of a language or hundreds, you will always be constrained by the programming language. The reason you need to learn how to program is because there isn’t a command to do every little thing; you have to understand the set of things that a programming language can do, and then use your creativity and problem-solving skills to get the computer to do what you want.
    4. In this class, we will repeatedly run into the challenges we encountered today. Even seemingly simple problems will require us to creatively apply the tools we have available: the commands or instructions provided by the programming language.
    5. Multiple approaches are always possible to solve a problem. Furthermore, we may never be sure we have found the most efficient one. We may not even agree about how we should measure efficiency.
    6. As we saw today, even when designing programs using four commands to draw with a turtle, the solutions are not always easy. We will definitely need to keep practicing as we start tackling more complex challenges.

Unit 3, Chapter 1, Lesson 5: Creating Functions

Overview

In this lesson, students learn to define and call procedures (in JavaScript, procedures are called “functions”) in order to create and give a name to a group of commands for easy and repeated use in their code. They will be introduced to functions as a form of abstraction that enables them to write code in larger, more logical chunks and focus on what something does, rather than how it does it. As they explore the use of functions through a sequence of activities in App Lab, they will be asked to think about where they see the need for functions and how these functions can make their code clearer or more concise.

At the end of the lesson students review the concept of abstraction and are introduced to elements of the Create PT in preparation for the Practice PT at the end of the unit.

Purpose

Programming languages must necessarily define the meaning of a set of commands which are generally useful and applicable. In order to extend their functionality, nearly all programming languages provide a means for defining and calling new commands which programmers design to fit the needs of the problems they are trying to solve. Defining functions is an example of how computer scientists use abstraction to solve problems. A programmer will design a solution to a small, well-defined portion of the task and then give a name to the associated code. Whenever that problem arises again, the programmer can invoke the new function by name, without having to solve the problem again. This ability to refer to complex functionality by simple, meaningful names allows for programs to be written in more intuitive ways that reflect the relationships between different blocks of code.

Objectives

Students will be able to:

  • Recognize functions in programs as a form of abstraction.
  • Write a program that solves a turtle drawing problem using multiple levels of abstraction (i.e. functions that call other functions within your code).
  • Explain why and how functions can make code easier to read and maintain.
  • Define and call simple functions that solve turtle drawing tasks.

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.
  • Function – A named group of programming instructions. Functions are reusable abstractions that reduce the complexity of writing and maintaining programs.

New Code

Getting Started

  1. In the previous lesson we created simple turtle drawings using only four commands. At some point you probably wished that more commands were available to you. What was one command you wanted to be able to use and explain why you wanted to use it.
  2. Programming languages will always have some commands that are already defined, but there will be many instances when the exact command we want isn’t available. Today we’re going to start exploring a powerful feature of most programming languages that will allow us to overcome this issue and create commands of our own.

Activity–Programming with Functions

  1. Log in to code.org
  2. Work through the lesson on your own–be sure to READ EVERYTHING!!
  3. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. At the end of this unit we will be doing a Practice Create PT that mimics most components of the AP Create PT. We’re going to quickly review those components now, but we’ll have opportunities to review and practice them in the next few lessons as well. For right now you don’t need to understand all the details, just the big picture.
  2. Open this file–read the following sections to give you an overview of your final project for this unit:
    1. Page 9–Performance Task: Create–Applications From Ideas has 3 major components (you will skip the first 2 at this time):
      1. Video
      2. Written Responses
      3. Program Code
    2. Pages 10-11–Skim the submission requirements and actually read all of prompts 2a to 2d–concentrate most on “abstraction” and prompt 2d
  3. Let’s start now making connections between writing functions and “developing abstractions” that helps us when writing to programs. Respond to the following in your Word Online file for this class:
    1. List the benefits of being able to define and call functions in a program. Who specifically gets to enjoy those benefits?
    2. How is the use of a function an example of abstraction?
    3. Which of the following 2 items are true about functions:
      1. Meaningful function names help people better understand programs.
      2. Meaningful function names help computers better understand programs.
      3. Functions in programming are useful mathematical tools for doing complex computations.
      4. Functions in programming are named groupings of programming instructions.
    4. In your own words explain at least one reason why programming languages have functions.

Unit 3, Chapter 1, Lesson 6: Functions and Top-Down Design

Overview

This lesson presents a top-down problem-solving strategy for designing solutions to programming problems. Students use a worksheet to learn about top-down design, and then on paper, design a solution to a new turtle drawing challenge with a partner. Having practiced this approach on paper and in code, students will be re-presented with the 3×3 square challenge from an earlier lesson and asked to improve upon their old solution by designing multiple layers of functions.

Purpose

The main purpose here is to familiarize students with the concept of developing “procedural abstractions.” One of the main learning objectives in the CSP framework is: “2.2.1 Develop an abstraction when writing a program…”. Furthermore the AP Performance Task: Create requires students to “develop an abstraction to manage complexity of your program.” For all intents and purposes, developing abstractions starts with writing reusable functions (or procedures) in your code that encapsulate and give a name to multi-line segments of code that other parts of your code calls upon.

A technique for deciding what functions you should write is to look at the problem with a “top-down design” perspective. The process of creating software begins long before the first lines of code are written. Breaking a problem down into layers of sub-tasks, and writing well-named functions that solve those tasks is a creative act of abstraction. It also leads to good code that is more efficient, easier to read, and therefore easier to debug when problems arise.

In professional settings, teams of people first identify the problems and sub-problems the particular software will be addressing and how it will be used. This approach to designing software is critical when facing large-scale programming tasks. Once the problem is well understood, it can be broken into parts that teams or individual programmers can begin to work on solving at the same time. Full software systems take advantage of the power of abstraction; each programmer in a team can write code, assuming the subproblems will be solved and written by other teammates.

Objectives

Students will be able to:

  • Write a complete program with functions that solve sub-tasks of a larger programming task.
  • Explain how functions are an example of abstraction.
  • Use a “top-down” problem-solving approach to identify sub-tasks of a larger programming task.

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.
  • Function – A named group of programming instructions. Functions are reusable abstractions that reduce the complexity of writing and maintaining programs.
  • Top Down Design – a problem solving approach (also known as stepwise design) in which you break down a system to gain insight into the sub-systems that make it up.

New Code

Getting Started

  1. In the previous lesson we wrote a program that used layers of functions (functions that called other functions) to get the turtle to draw a diamond-shaped figure.
  2. Imagine that you have two programs that drew the diamond-shaped figure. One program uses functions as we did in the previous lesson. The other doesn’t use functions; it’s just a long sequence of the turtle’s primitive commands. Which program is more efficient? Make an argument for why one is more efficient than the other. Share your arguments for one program over the other … “Efficient” can mean several different things here:
    1. It could mean the total number of primitive operations performed by the turtle.
    2. It could mean number of lines of code.
    3. It could hinge on the ability to reuse code within your own code.
    4. It could be about the speed and clarity with which you can write the program.
      1. All of these are valid arguments for a student to make.
  3. Efficiency is an interesting thing to think about, but functions also introduce the ability to leverage the power of abstraction: when we write a function, it solves a small piece of a bigger problem. Having the small problem solved allows us to ignore its details and focus on bigger problems or tasks.
  4. Today we’ll get more practice with thinking about how to break problems down into useful functions.

Activity

  1. Get the Top-Down Design Worksheet & complete it:
    1. Students should work in pairs.
    2. Read the first page of the worksheet that describes the top-down problem solving process.
    3. Design a solution to the problem on the second page by writing down the functions they would write to solve the problem.
    4. After a pair has come up with a solution on paper, have them compare with another group to see similarities and differences.
      1. The point of having students compare top-down designs is mostly just to see that people think about problems differently. Pairs should move to Code Studio after working out a solution on paper.
      2. Evidence of good design
        1. An interesting thing to look at is the name of the top-level function students come up with, which should be a description of what they think they are drawing.
        2. Try to come up with descriptive function names that give insight to their thinking. A high-level function named something like drawThing is not that great. Something like snowflake or crosshairs or antenna is better because it lets the reader see what the programmer is thinking about.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When we layer functions – with functions that call other functions – we are creating layers of abstraction.
  2. In programming, writing functions helps us create layers of abstraction that allow us to design and create increasingly complex systems.
  3. We’ve seen layers of abstraction before in the design of Internet protocols, or in the binary encoding of information.
  4. Solving a fundamental piece of a problem that can be reliably reused in a different context frees us to think about more complex problems because we can trust the piece that has been solved and don’t have to worry about its details.
  5. Solving small problems – like how to send a single bit from one place to another – allows us to think about bigger problems, like sending numbers, or text, or images, to multiple people, over networks, in packets…etc., etc., etc.
  6. Where else in your life have you seen layers of abstraction? Connect the idea of layers of abstraction to some other activity. Include your response in your Word Online file for this class.
  7. There are many possible connections to make since almost any task in life can be broken down ad-infinitum. In the video about functions from the previous lesson, Chris Bosh makes a connection to basketball. Once you know how to dribble and shoot, then you learn some moves to do, and once you know that, you run plays that rely on the fact that those fundamental elements (or the problems) have been solved.
  8. In your Word Online file for this class, respond to the following:
    1. Which of the following statements about writing functions and Top-Down Design is NOT true?
      1. Writing functions helps manage complexity in a program.
      2. Top-Down Design leads to programs which feature multiple layers of abstraction.
      3. Two programmers solving the same problem using Top-Down Design should arrive at identical programs.
      4. Top-Down Design relies upon identifying subproblems of a larger problem.
      5. Top-Down Design assists in identifying the layers of functions that will be used to solve a programming problem.
    2. In the Create Performance Task you will be asked to identify an abstraction in your program and explain how it helps manage the complexity of the program. Functions are a form of abstraction. Pick a function you wrote in your solution to the 3×3 square problem and explain how it helps manage the complexity of your program.

MAKE UP DAY–Get everything in code.org through Lesson 6

All 9-11 graders fill out the FBLA form please.

Unit 3, Chapter 1, Lesson 7: APIs and Using Functions with Parameters

Overview

Students will learn to read App Lab’s API documentation and will use functions that accept parameters in order to complete a series of drawing puzzles which require them to make use of the App Lab API documentation to learn new drawing commands. Many of these commands will require the use of parameters. The final challenge asks students to design a personal monogram making use of the commands they learned during the lesson.

Purpose

An API is a reference guide which catalogs and explains the functionality of a programming language. If a programmer develops the practice of referencing an API, she can make full use of that functionality without undergoing the tedium of memorizing every detail of the language. In today’s lesson, students will need to read through the API in order to find and understand new commands for moving the turtle, selecting colors, and drawing different-sized dots and lines on the screen. Students should not necessarily understand every command in the drawing API in detail, but they should be familiar with referencing the API as a standard part of the process of writing a program. This will also be the first time students are given access to drawing functions that take parameters (e.g., moveForward(40) vs. moveForward()).

Objectives

Students will be able to:

  • Use parameters to provide different values as input to procedures when they are called in a program.
  • Use API documentation to assist in writing programs.
  • Define an API as the set of commands made available by a programming language.

Vocab

  • API – a collection of commands made available to a programmer
  • Documentation – a description of the behavior of a command, function, library, API, etc.
  • Hexadecimal – A base-16 number system that uses sixteen distinct symbols 0-9 and A-F to represent numbers from 0 to 15.
  • Library – a collection of commands / functions, typically with a shared purpose
  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. So far in this unit we have been exploring programming by drawing turtle art with only a few commands. It will probably not surprise you to learn that there are many more commands included in most programming languages, including the version of JavaScript included in App Lab. In fact, most programming languages include hundreds if not thousands of commands.
  2. Do you think programmers memorize all of the commands in a programming language? If not, how is anyone ever able to use an entire programming language?
  3. Programmers weren’t born knowing how a programming language works, and, like you and me, they don’t have perfect memories. Instead they rely on written documentation to help them learn new features of a language and recall how it works. Today we are going to be exploring how useful documentation can be when learning a programming language or just writing software.
    1. FYI: Programming is not some innate talent. Every programmer has to learn by seeing examples of a language being used and reading documentation. In fact, even professional programmers will frequently reference documentation while designing software. Becoming a good programmer is much less about memorizing a language and more about learning habits of mind and patterns that allow you to use a language (including its documentation) effectively!

Activity

  1. At end of the day we hope to be much more talented turtle artists, but we’re also going to be learning another important skill: reading the documentation of a programming language.
  2. Before you ask me or a classmate for help today, I want you to read through the documentation, try the examples, talk with friends, and then talk to me. It may be slower going today, but in the long term it will make you much more confident programmers.
  3. Be sure to read the explanation of the term parameter and not just skip it. It’s an important term to know.
  4. Log in to code.org
  5. Work through the lesson on your own–be sure to READ EVERYTHING!!
  6. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. The level progression for today’s lesson includes many important vocabulary words. While these levels attempt to introduce these words in the context of using them, take a moment at the conclusion of class to review the words covered and ensure students are comfortable using them.
    • Parameter: accepts a value to be passed to a function, typically affecting the behavior of that function (e.g., changing the distance the moveForward() command moves the turtle)
    • Library: a collection of commands / functions, typically with a shared purpose (e.g., a library of functions for manipulating the turtle)
    • API: application program interface, the full set of commands included in a programming language (e.g., every command made available by App Lab)
    • Documentation: a description of the behavior of a function, library, API, etc.
  2. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: What is an API?
      • Abstract Programming Inheritance: The idea that abstractions in languages get “passed down” in newer versions
      • Artificial Parameter Intelligence: The idea that function parameters should be intelligent enough to “know” what you want as a programmer
      • Application Program Interface: A well-documented library of functions provided in a programming language that helps to simplify complex programming tasks.
      • Abstract Parameter Interface: A high-level description of the parameters a function accepts
    2. Multiple Choice: What is a function parameter?
      • “para-meter” — a measure of the distance between a function’s conception and implementation.
      • A way to give input to a function that controls how the function runs.
      • A collection of commands that can be used in a programming language.
      • Another name for the purpose of a function.
      • A named memory location.
    3. Free Response: It is said that functions with parameters generalize the behavior of a more specific command. Explain what this sentence means to you using the difference between turnLeft() and turnLeft(angle).

Unit 3, Chapter 1, Lesson 7: APIs and Using Functions with Parameters

Overview

Students will learn to read App Lab’s API documentation and will use functions that accept parameters in order to complete a series of drawing puzzles which require them to make use of the App Lab API documentation to learn new drawing commands. Many of these commands will require the use of parameters. The final challenge asks students to design a personal monogram making use of the commands they learned during the lesson.

Purpose

An API is a reference guide which catalogs and explains the functionality of a programming language. If a programmer develops the practice of referencing an API, she can make full use of that functionality without undergoing the tedium of memorizing every detail of the language. In today’s lesson, students will need to read through the API in order to find and understand new commands for moving the turtle, selecting colors, and drawing different-sized dots and lines on the screen. Students should not necessarily understand every command in the drawing API in detail, but they should be familiar with referencing the API as a standard part of the process of writing a program. This will also be the first time students are given access to drawing functions that take parameters (e.g., moveForward(40) vs. moveForward()).

Objectives

Students will be able to:

  • Use parameters to provide different values as input to procedures when they are called in a program.
  • Use API documentation to assist in writing programs.
  • Define an API as the set of commands made available by a programming language.

Vocab

  • API – a collection of commands made available to a programmer
  • Documentation – a description of the behavior of a command, function, library, API, etc.
  • Hexadecimal – A base-16 number system that uses sixteen distinct symbols 0-9 and A-F to represent numbers from 0 to 15.
  • Library – a collection of commands / functions, typically with a shared purpose
  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. So far in this unit we have been exploring programming by drawing turtle art with only a few commands. It will probably not surprise you to learn that there are many more commands included in most programming languages, including the version of JavaScript included in App Lab. In fact, most programming languages include hundreds if not thousands of commands.
  2. Do you think programmers memorize all of the commands in a programming language? If not, how is anyone ever able to use an entire programming language?
  3. Programmers weren’t born knowing how a programming language works, and, like you and me, they don’t have perfect memories. Instead they rely on written documentation to help them learn new features of a language and recall how it works. Today we are going to be exploring how useful documentation can be when learning a programming language or just writing software.
    1. FYI: Programming is not some innate talent. Every programmer has to learn by seeing examples of a language being used and reading documentation. In fact, even professional programmers will frequently reference documentation while designing software. Becoming a good programmer is much less about memorizing a language and more about learning habits of mind and patterns that allow you to use a language (including its documentation) effectively!

Activity

  1. At end of the day we hope to be much more talented turtle artists, but we’re also going to be learning another important skill: reading the documentation of a programming language.
  2. Before you ask me or a classmate for help today, I want you to read through the documentation, try the examples, talk with friends, and then talk to me. It may be slower going today, but in the long term it will make you much more confident programmers.
  3. Be sure to read the explanation of the term parameter and not just skip it. It’s an important term to know.
  4. Log in to code.org
  5. Work through the lesson on your own–be sure to READ EVERYTHING!!
  6. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. The level progression for today’s lesson includes many important vocabulary words. While these levels attempt to introduce these words in the context of using them, take a moment at the conclusion of class to review the words covered and ensure students are comfortable using them.
    • Parameter: accepts a value to be passed to a function, typically affecting the behavior of that function (e.g., changing the distance the moveForward() command moves the turtle)
    • Library: a collection of commands / functions, typically with a shared purpose (e.g., a library of functions for manipulating the turtle)
    • API: application program interface, the full set of commands included in a programming language (e.g., every command made available by App Lab)
    • Documentation: a description of the behavior of a function, library, API, etc.
  2. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: What is an API?
      • Abstract Programming Inheritance: The idea that abstractions in languages get “passed down” in newer versions
      • Artificial Parameter Intelligence: The idea that function parameters should be intelligent enough to “know” what you want as a programmer
      • Application Program Interface: A well-documented library of functions provided in a programming language that helps to simplify complex programming tasks.
      • Abstract Parameter Interface: A high-level description of the parameters a function accepts
    2. Multiple Choice: What is a function parameter?
      • “para-meter” — a measure of the distance between a function’s conception and implementation.
      • A way to give input to a function that controls how the function runs.
      • A collection of commands that can be used in a programming language.
      • Another name for the purpose of a function.
      • A named memory location.
    3. Free Response: It is said that functions with parameters generalize the behavior of a more specific command. Explain what this sentence means to you using the difference between turnLeft() and turnLeft(angle).

Unit 3, Chapter 1, Lesson 8: Creating Functions with Parameters

Overview

In this lesson, students practice using and creating functions with parameters. Students learn that writing functions with parameters can generalize solutions to problems even further. Especially in situations where feel like you are about to duplicate some code with only a few changes to some numbers, that is a good time to write a function that accepts parameters. In the second half of the lesson, students make a series of modifications to a program that creates an “Under the Sea” scene by adding parameters to functions to more easily add variation to the scene. Lastly, students are introduced to App Lab’s random number functions to supply random values to function calls so the scene looks a little different every time the program runs.

Purpose

Writing functions with parameters is a simple idea, but it traditionally has some devilish details for new learners of programming. The basic idea is that you often want to write a function that takes some input and performs some action based on that input. For example, the turtle function moveForward is much more useful when you can specify how much to move forward (e.g., moveForward(100)), rather than just a fixed amount every time. It’s very common to encounter situations where as a programmer you realize that you basically need a duplicate of some code you’ve already got, but you just want to change some numbers. That’s a good time to write a function with a parameter; the parameter just acts as a placeholder for some value that you plug in at the time you call the function. Just like it’s considered good practice to give descriptive names to your functions, the same is true for the names of the parameters themselves. For example: drawSquare(sideLength) is better than drawSquare(stuff).

Objectives

Students will be able to:

  • Write functions with parameters to generalize a solution instead of duplicating code.
  • Identify appropriate situations for creating a function with parameters.
  • Use random numbers as inputs to function calls for the purpose of testing.
  • Add parameters to a function in an existing piece of code to generalize its behavior.

Vocab

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. In the previous lesson, we learned to use a lot of new turtle commands. Some of these commands accept a parameter, or even many parameters, which allow us to pass values to the function. This allowed us to make much more interesting images by specifying precisely how far the turtle should move or turn, and introduced the ability to choose specific pen sizes and colors.
  2. Parameters are a powerful programming construct.
    1. Suppose we have a whole group of similar problems, like turning the turtle some amount.
    2. Without a parameter we would need 360 different functions, one for each number of degrees we wanted to turn!
    3. Parameters allow us to use a single function as a general solution to a whole group of problems.
  3. This is clearly a useful construct to use in our programs, and in today’s lesson we’re going to learn how to create functions with parameters for ourselves.

Activity

  1. The levels in Code Studio for this lesson walk students through a number of small exercises that build up to making a small “under the sea” drawing.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When do you need a function with a parameter?
  2. Having used parameters to generalize the behavior of many functions, students should attempt to formalize their understanding of what parameters are and why they are beneficial. Important points:
    1. Parameters allow the creation of a generalized solution to a whole class of problems, rather than individually solving many specific problems.
    2. Parameters remove the need to create repetitive functions, making code easier to write, read, and change.
  3. In your Word Online file for this class, develop a rule for deciding when to create a function with a parameter rather than a normal function. Below your rule write a couple sentences justifying your rule. Share your rules with the class.
  4. Every time you added a parameter to a function, you generalized the behavior of the function without having to rewrite the code.
  5. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: Which of the following are true?
      • Functions with parameters can be used to prevent the creation of duplicated code.
      • Parameters can only be used once within the body of a function.
      • Parameters generalize the solution of a specific problem.
      • Parameters need not be provided to a function in any particular order.
    2. Free Response: “Abstraction” is often used to indicate cases where we focus on a general case and ignore a specific instance of a problem. Given this meaning of the word, how are functions with parameters an example of abstraction?

Lesson 14: Project – Final Personal Website

Web Lab | Project

Overview

Students have spent a lot of time throughout the unit working on their Personal Website. In the final couple of days students finalize their websites. They work with peers to get feedback, put the finishing touches on the websites, review the rubric and reflect on their process. To cap off the unit, they will share their projects and also a overview of the process they took to get to that final design.

Objectives

Students will be able to:

  • Apply CSS styles across an entire website
  • Explain the design choices they made on their website to other people
  • Prioritize and implement incremental improvements

Day 1

Define: Rubric Review

  1. Over the course of the whole unit you have been developing a personal website. Over the next couple of classes you will be creating a final version of that project. As we prepare to showcase your work, we will use the problem solving process as our guide to ensure we have the best quality product possible.
  2. The first step of the problem solving process is to define the problem. To help define our problem we need to understand the expectations of the final product. The rubric for your Personal Website will help us. Let’s go over it before starting.
  3. Get a copy of he project guide. Review the rubric portion of the Project Guide and ask questions,

Plan: Finishing Personal Website

  1. Next you will begin the planning stage of the problem solving process. Keep in mind you have limited time to complete this project so you will need to prioritize the work you need to.
  2. You should use the project guide to plan out the work you will do to finish your Personal Website.

Try: Finalize Personal Website

  1. Now that you all have plans, it is time to begin implementing your plan. We will be doing a peer review as a class. You should work to make a polished product to share during the peer review.
  2. Log onto Code Studio and begin finalizing your website by working on Levels 1 & 2.
  3. Don’t forget to take a screenshot of your home page and save it somewhere on your computer so you can find it later (Need help with how to screenshot? Check out this website .)

Day 2

  1. You should now have a polished product you are proud of. An important part of any major project is to get feedback from people not working on that project with you. They may bring some perspective you might have missed. We will spend today giving and getting feedback. Then you will reflect on how to put this feedback into action.

Reflect: Peer Review

  1. Get a copy of the peer review guide.
  2. Get with a partner.
  3. Peer Review Process–Students will:
    1. Open up their website projects in Web Lab.
    2. Fill in the top part of the worksheet, identifying what they would like feedback on.
    3. Trade places with their partner so their partner is now looking at their sheet and website.
    4. Give feedback on partner’s work.
    5. Switch back to their sheet and website to review feedback.
    6. Make a plan for implementing some of the feedback.

Plan and Try: Final Touches

  1. Return to Code Studio and make any improvements that were identified in the peer review session. If you did not get any suggestions from the peer review, ask your teacher to give some suggestions.
  2. Be sure to also review the rubric as a final way to check your work.

Reflect: Final Reflection

  1. Setup: You will need your journal and all of your screenshots of the progress on your home page. Print each screenshot.
  2. In your journal respond to each of the following:
    1. I am most proud of the following aspect(s) of my personal website:
    2. The biggest challenge that I overcame so far in making my personal website:
    3. Improvements I still want to make to my website are:
    4. If I knew at the beginning of this project what I know now, I would have started it differently by doing this:
    5. I would describe the level of effort I’ve invested into this project as:
  3. Go to Lesson 14, Level 3 in Code Studio to complete your reflection on your attitudes toward computer science. Your answers are anonymous.

Day 3

Showcase Set Up

  1. Setup: Students need:
    1. A computer to display the website.
    2. A way to display their website progression screenshots

Student Website Showcase

  1. You should stand next to your computer and talk to people attending the showcase about your work.

Post-Project Test

The post-project test is found at the bottom of the Web Development unit overview page on Code Studio (studio.code.org/s/csd2-2019).

This test is locked and hidden from student view by default. In order for students to see and take this test, you’ll need to unlock it by clicking the “Lock Settings” button and following the instructions that appear.

CSD Unit 3 – Animations and Games

Chapter 1 – Images & Animations

Lesson 1: Programming for Entertainment

Unplugged

Overview

Students are asked to consider the “problems” of boredom and self expression, and to reflect on how they approach those problems in their own lives. From there, students will explore how Computer Science in general, and programming specifically, plays a role in either a specific form of entertainment or as a vehicle for self expression.

Objectives

Students will be able to:

  • Identify how computer science is used in a field of entertainment

Warm Up (10 min)

The Entertainment Problem

Why do we seek out entertainment? Whether it’s movies, music, art, games, or any number of other forms of entertainment, what problem does entertainment solve for us? What is your favorite form of entertainment, and what problem does it solve for you?

Activity (45 min)

CS in Entertainment

Think about the forms of entertainment that students identified in the warm up and ask them whether (and how) Computer Science plays a role in that field.

Place students in groups of three. Consider allowing students to group based on common interest as each group will be exploring a field of entertainment together.

Give each group a copy of the activity guide.

CS in Entertainment

During this activity student groups will do some light research into the role that CS and programming play in various fields of entertainment. The primary goal of this activity is to broaden students’ perspective about how programming can be used to make fun or entertaining things. Some of the fields that students could research (such as art, animation, and games) can be directly connected to programs they will write later in this unit, while others may serve more as an inspiration for how the skills that they learn here may be applied in different domains.

Entertainment Exploration

  • Introduce the topics: In the activity guide we’ve listed a number of potential fields for research. These specific fields were chosen to go along with resources that are provided on Code Studio, but you can allow students to look into other fields if they wish.
  • Explain the exploration task: The goal of this exploration is twofold:
    • First, develop a deeper understanding of how programming is used in your chosen field. How is computer technology changing this field, what are some of the problems that people are trying to solve with technology?
    • Second, identify some interesting applications of CS or facts to share. What are some cool things that people are doing in this field that make use of CS?
  • Share selected research links: On Code Studio, inside the blue teacher box, we have compiled a handful of useful sites to help students kick off their research. Share the links that you feel are most helpful and appropriate for your class.

Wrap Up (5 min)

Looking Forward: Explore independently, the example programs at the end of this lesson’s Code Studio progression. These programs are designed to show a variety of different kinds of programs that it’s possible to make in Game Lab.

Journal: Based on what you saw today, both in your research and the example apps, what kinds of programs are you most interested in learning to create?

Lesson 2: Plotting Shapes

Unplugged

Overview

Students explore the challenges of communicating how to draw with shapes and use a tool that introduces how this problem is approached in Game Lab. The warm up activity quickly demonstrates the challenges of communicating position without some shared reference point. In the main activity students explore a Game Lab tool that allows students to interactively place shapes on Game Lab’s 400 by 400 grid. They then take turns instructing a partner how to draw a hidden image using this tool, accounting for many challenges students will encounter when programming in Game Lab. Students optionally create their own image to communicate before a debrief discussion.

Objectives

Students will be able to:

  • Reason about locations on the Game Lab coordinate grid
  • Communicate how to draw an image in Game Lab, accounting for shape position, color, and order

Warm Up (10 min)

Communicating Drawing Information

We saw a lot of different programs yesterday, and you started to think about what types you might want to create. When we create a program, one of the things we need to do is draw everything on the screen. We’re going to try that with a “student” computer today.

One or two volunteers come to the front of the room and act as “computers” for the activity. They should sit with their backs to the board so that they cannot see what is being projected. Give each volunteer a blank sheet of paper.

Display: Project Sample Shape Drawing – Exemplar where it can be seen by the class.

You will need to explain to our “computer” how to draw the picture. In the end, we’ll compare the drawing to the actual picture.

Give the students a minute or two to describe the drawing as the students at the front of the room try to draw it. After one minute, stop them and allow the students to compare both pictures.

Prompt: What are the different “challenges” or problems we’re going to need to solve in order to successfully communicate these kinds of drawings. Ailently write their answers in their journals.

There were several challenges we needed to solve in this activity. We need to be able to clearly communicate position, color, and order of the shapes. We’re going to start exploring how to solve this problem.

Activity (35 min)

Drawing with a Computer

Group: Place students in pairs.

Transition: Have one member of each group open a laptop and go to the contents for this lesson. There is a single level with a Game Lab tool.

Prompt: Working with your partner take two or three minutes to figure out how this tool works. Afterwards be ready to share as a class.

Location of the Origin: The origin of this grid, as well as the origin in Game Lab, lies at the top left corner. This reflects the fact that documents tend to start at the top left, and ensures that every point on the plane has positive coordinates.

Drawing Shapes

Distribute activity guides to each pair, ensuring that one student (Student A) receives Version A and the other student (Student B) receives the Version B. Students should not look at each other’s papers.

Set Up: In this activity, students will try to recreate images based on a partner’s directions. The student who is drawing will use the shape drawing tool on Game Lab to draw the shapes. Students should keep their drawings hidden from one another throughout the activity. While completing a drawing the instruction giver should also not be able to see the computer screen.

Drawing 1: Each member of the pair should complete their first drawing, taking turns giving instructions and using the tool. These drawings do not feature any overlapping shapes, but students may need to grapple with the fact that circles are drawn from the middle and squares from the top left corner. Additionally students may just struggle with the direction of the Y-axis.

Drawing 2: Each member of the pair should describe their second drawing to their partner. These drawing feature overlapping shapes and so students will need to consider the order in which shapes are being placed as well as when they should change the color of the pen.

Draw Your Own: If time allows, give students a chance to create their own drawing to communicate to their partner.

When we make images, we need a way to communicate exactly where each shape goes. The coordinate plane helps us to do that. Our coordinate plane has two coordinates, x and y. The x-coordinate tells us how far our shape is from the left of the grid. The y-coordinate tells us how far our shape is from the top of the grid. The black dots on the shapes help you be very specific about how the shape is placed on the grid.

Wrap Up (5 min)

Journal: Have students reflect on each of the following prompts

  • What things were important in communicating about position, color, and order of the shapes in this activity?
  • What’s a way you have seen similar problems solved in the past?

At the beginning of class we saw that communicating how to draw even simple shapes can be pretty challenging. The grid we learned about today is one solution to this problem but there are many others that could’ve worked. In fact a lot of you probably noticed that the grid in Game Lab is “flipped”. Computer screens come in all different shapes and sizes, as does the content we show on them. We need to agree on one point where all the content can grow from. Since we read starting at the top left corner, the grid on a computer screen starts at the top left corner as well. There’s also the benefit of not having to use any negative numbers to talk about locations on the screen. Don’t worry if this flipped grid is a little tricky still. We’ll have plenty more time to work on it in coming lessons.

Lesson 3: Drawing in Game Lab

Game Lab

Overview

Students are introduced to Game Lab, the programming environment for this unit, and begin to use it to position shapes on the screen. They learn the basics of sequencing and debugging, as well as a few simple commands. At the end of the lesson, students will be able to program images like the ones they made with the drawing tool in the previous lesson.

Objectives

Students will be able to:

  • Use a coordinate system to place elements on the screen.
  • Sequence code correctly to overlay shapes.

Vocabulary

  • Bug – Part of a program that does not work correctly.
  • Debugging – Finding and fixing problems in an algorithm or program.
  • Program – An algorithm that has been coded into something that can be run by a machine.

Introduced Code

Warm Up (5 minutes)

Programming Images

Goal From Unit 2, students may remember that a computer can only understand what to do if you use a particular language in order to communicate with it. For Web Development, that language was HTML. Computers can’t “figure out” what you mean in the same way that a human can, and they are usually much more specific in how they follow instructions.

In the last lesson we created images on the computer by organizing squares and circles on a grid. For each image you wanted to create, you had to lay those images out manually, and if you wanted to recreate an image it was a lot of work. Today, we’re going to program the computer to draw those images for us. Based on what you know about computers, what do you think will be different between telling a person about your image and telling a computer about your image?

In order to give instructions to a computer, we need to use a language that a computer understands. In the last unit, we used HTML, which is great for making web pages. To make our animations and games, we will use a version of Javascript that uses blocks. The environment that we’ll be programming in is called Game Lab.

Activity (30 minutes)

Here are some things to remember when programming:

  • One command per line
  • Commands run in order from top to bottom
  • Order of inputs into shape commands matter
  • Each input into shape commands are separated by commas
  • (0,0) is in the upper left corner of the display
  • All x and y values on the display are positive

Simple Drawing in Game Lab

Group: Place students in pairs to program together.

Transition: Send students to Code Studio.

Support: As students work on the levels you can help them but encourage them to try to spend some time figuring things out themselves first. If you need help supporting students, see the exemplars in the teacher answer viewer. When students hit the challenge levels, they can choose to pursue one or more of the challenges, return to improve upon previous levels, or help a classmate.

Wrap Up (10 minutes)

Share Drawings

Goal: Students get to see the variety of different things you can create with just simple shape drawings.

Share: Once students have completed their drawings have them share their drawings with the class. One way to do this is with a gallery walk.

Exit Ticket

Goal : Students share tricks they learned as they went through levels.

Prompt: Today you learned how to draw in Game Lab for the first time. What type of advice would you share with a friend who was going to learn about drawing in Game Lab to make it easier for them? Write it down on a piece of paper.

Collect: Collect answers from students and pick out a few that might be helpful for all students to hear. Share those at the beginning of the next class.

DO THE LESSON 3 CHALLENGES

Lesson 4: Shapes and Randomization

Game Lab

Overview

In this lesson students continue to develop their familiarity with Game Lab by manipulating the width and height of the shapes they use to draw. The lesson kicks off with a discussion that connects expanded block functionality (e.g. different sized shapes) with the need for more block inputs, or “parameters”. Students learn to draw with versions of ellipse() and rect() that include width and height parameters. They also learn to use the background() block. At the end of the progression students are introduced to the randomNumber() block. Combining all of these skills students will draw a randomized rainbow snake at the end of the lesson.

Objectives

Students will be able to:

  • Use and reason about drawing commands with multiple parameters
  • Generate and use random numbers in a program

Vocabulary

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

Introduced Code

Warm Up (5 min)

  1. ellipse()
  2. randomNumber(5, 10)
  3. rect

Shapes of Different Sizes

Prompt: Our ellipse and rect blocks each have two inputs that control where they’re drawn – the x and y position. If you wanted these commands to draw a wider variety of rectangles and ellipses, what additional inputs might you need to give these blocks? What would each additional input control?

If we want our blocks to draw shapes in different ways they’ll need more inputs that let us tell them how to draw. The inputs or openings in our blocks have a formal name, parameters, and today we’re going to be learning more about how to use them.

Activity (40 min)

Programming Images

Transition: Move students onto Code Studio

Wrap Up (5 min)

Journal: Have students reflect on their development of the five practices of CS Discoveries (Problem Solving, Persistence, Creativity, Collaboration, Communication). Choose one of the following prompts as you deem appropriate.

  • Choose one of the five practices in which you believe you demonstrated growth in this lesson. Write something you did that exemplified this practice.
  • Choose one practice you think you can continue to grow in. What’s one thing you’d like to do better?
  • Choose one practice you thought was especially important for the activity we completed today. What made it so important?

TRY THE LESSON 4 CHALLENGE

Lesson 5: Variables

Game Lab

Overview

In this lesson students learn how to use variables to label a number in their program or save a randomly generated value. Students begin the lesson with a very basic description of the purpose of a variable. Students then complete a level progression that reinforces the model of a variable as a way to label or name a number. Students use variables to save a random number to see that variables actually store or save their values, allowing them to use the same random number multiple times in their programs.

Objectives

Students will be able to:

  • Identify a variable as a way to label and reference a value in a program
  • Use variables in a program to store a piece of information that is used multiple times

Vocabulary

  • Variable – A placeholder for a piece of information that can change.

Introduced Code

Warm Up (10 Mins)

Labels and Values

Video: As a class watch the video introducing variables.

Review: Students can review the most important points from the video on the map level in Level 4. Students don’t need to understand all of these ideas right now, but they can use this level as a reference throughout the lesson.

There’s a lot to learn about variables and we’ll be seeing them throughout this unit. Today we’re going to see them used to help us draw pictures. The most important thing we care about today, though, is just seeing how giving a label to a value helps us write programs.

Activity (30 Mins)

Programming with Variables

Students should understand that variables hold information and an be accessed using their labels. With simple drawings, students may not see the power of variables, so you may want them to think of some different apps that they use and what information needs to be stored for the app to work, or think about a more complex program that they want to use variables for.

Numbers, text, and colors can all go into variables, as well as more complicated data structures that students will see later in the course.

Wrap Up (5 Mins)

Prompt: Give students the following prompts

  • What is your own definition of a variable?
  • Why are variables useful in programs?
Input-Output-Store-Process: The model students learned in Unit 1 might be nice to reference here. Students are storing information in a variable which means they are saving that information in memory.

CSS Classes: If students studied CSS classes in Unit 2 then they may be familiar with the act of creating a name for something in their programs in order to be able to reference it. While the context here is different, the idea of naming remains the same.

Journal: What connections do you see between variables and what you learned about the Input-Output-Store-Process model of a computer?

TRY THE LESSON 5 CHALLENGES

Lesson 6: Sprites

Overview

In order to create more interesting and detailed images, students are introduced to the sprite object. Every sprite can be assigned an image to show, and sprites also keep track of multiple values about themselves, which will prove useful down the road when making animations.

Purpose

Keeping track of many shapes and the different variables that control aspects of those shapes can get very complex. There will be lots of variables with different variable names. Instead computer scientists created something called an object which allows for one variable name to control both the shape and all its aspects. In Game Lab we use a certain type of object called a sprite. A sprite is an on screen element with properties that control its look. Properties are the variables that are attached to a sprite. You can access them through dot notation.

Using the Animation Tab, students can create or import images to be used with their sprites. Later on, these sprites will become a useful tool for creating animations, as their properties can be changed and updated throughout the course of a program.

Objectives

Students will be able to:

  • Create and use a sprite
  • Use dot notation to update a sprite’s properties

Vocabulary

  • Property – Attributes that describe an object’s characteristics
  • Sprite – A graphic character on the screen with properties that describe its location, movement, and look.

Introduced Code

Warm Up (5 minutes)

The goal here is to get students thinking about all of the different values that go into drawing a single shape on the screen, and how many more values they may need to control a more detailed character in a program. If students are struggling to come up with ideas, you might use some of the following prompts: How do you tell a shape where to go on the screen? How do you tell a shape what size it needs to be? How do you tell a shape what color it should be? What about its outline? What if you wanted to change any of those values during your program, or control other things like rotation?

How Much Information?

Think, Pair, Share: So far we’ve only written programs that put simple shapes on the screen. Come up with a list of all of the different pieces of information that you have used to control how these shapes are drawn.

Prompt: What if we wanted to create programs with more detailed images, maybe even characters that you could interact with? What other pieces of information might you need in your code?

The sprite is a type of data called an object. While we aren’t yet explicitly introducing the concept of objects, students do need to understand that a sprite is a different type of value from the ones we’ve seen before, one that can hold references to many more values. For students who are curious about whether there are other objects in our programs, ask them to see if there are more blocks in the toolbox that follow the same dot notation (such as World.width and World.height)

Today we’ll learn how to create characters in our animations called sprites. These sprites will be stored in variables, just like you’ve stored numbers in the past, but sprites can hold lots of pieces of data, which will allow you to create much more interesting (and eventually animated!) programs.

Activity (45 min)

Introduction to Sprites

Distribute: (Optional) pass out copies of the activity guide. Students can use this sheet to plan out the Sprite Scene they create at the end of this lesson, but the planning can also be completed on scratch paper.

Transition: Send students to Code Studio

  • Video: Introduction to Sprites

Discussion Goals

Sprites are a very complex concept, and students may have difficulty understanding exactly what they are. The most important aspect for students to understand is that sprites allow them to organize a lot of information about something that they want to draw to the screen.

Students should make the connection between properties and variables, that both hold information that their program needs to run. Properties are accessed through their sprites, and Game Lab sprites already have specific properties that are automatically created when students create each sprite, such as x position, height, and rotation.

Sprites solve the problem of organizing a lot of information about how something should be drawn to a screen. Rather than creating new variables to hold all of that information, sprites use properties to hold all of the information about one thing that is drawn to the screen.

  • Video: The Animation Tab

Make sure students understand that they will need to both create the image (or animation) in the Animation Tab and then add the animation to the sprite using the setAnimation block. Students may be confused by the use of the word “animation” for single images, but in Game Lab, still images are considered “animations” with only one frame.

Students can use an animation already in the animation tab library, upload one from their computer, or create their own using the provided drawing tools. Additionally, students can use the drawing tools to modify the images they have chosen from the library or uploaded.

Misconception Alert!

Many students may now confuse the concepts of a sprite, its animation, and the image that it draws to the screen. In the next few lessons, watch out for this misconception, and reinforce the idea that a sprite’s animation is just one of its properties, the one that controls what image is drawn to the screen. Remind students that a single sprite may have different animations throughout the course of the program, just as other properties can change, and that two or more sprites might share the same animation.

Wrap Up (5-10 min)

Share: Allow students to share their Sprite Scenes. Encourage students to reflect on their scenes and identify ways in which they’d like to improve.

Assessment

Assessing Sprite Scenes

To assess Sprite Scenes, ask students to do a “talk through” of their code with you. Check to ensure that students know why they sequenced their code the way they did, and in particular look for “dead code”, or code that doesn’t impact the final scene. At this point it’s likely that students are still drawing shapes before they draw the background (which then won’t be seen) or that they are calling drawSprites() multiple times (it only needs to be called once).

TRY THE LESSON 6 CHALLENGES

Lesson 7: The Draw Loop

Game Lab

Overview

In this lesson students are introduced to the draw loop, one of the core programming paradigms in Game Lab. To begin the lesson students look at some physical flipbooks to see that having many frames with different images creates the impression of motion. Students then watch a video explaining how the draw loop in Game Lab helps to create this same impression in their programs. Students combine the draw loop with random numbers to manipulate some simple animations with dots and then with sprites. At the end of the lesson students use what they learned to update their sprite scene from the previous lesson.

Purpose

The draw loop is a core component of Game Lab. The fact that the Game Lab environment repeatedly calls this function many times a second (by default 30) is what allows the tool to create animations. This lesson has two goals therefore. The first is for students to see how animation in general depends on showing many slightly different images in a sequence. To help students have physical flipbooks they can use, a video, and a map level. The second goal is for students to understand how the draw loop allows them to create this behavior in Game Lab. Students should leave the lesson understanding that the commands in the draw loop are called after all other code but are then called repeatedly at a frame rate. Students will have a chance to continue to develop an understanding of this behavior in the next two lessons, but laying a strong conceptual foundation in this lesson will serve them well for the rest of the unit.

Objectives

Students will be able to:

  • Explain how the draw loop allows for the creation of animations in Game Lab
  • Use the draw loop in combination with the randomNumber() command, shapes, and sprites to make simple animations

Vocabulary

  • Animation – a series of images that create the illusion of motion by being shown rapidly one after the other
  • Frame – a single image within an animation
  • Frame Rate – the rate at which frames in an animation are shown, typically measured in frames per second

Introduced Code

Warm Up (5 mins)

Video: Show Flipbook Example – Video

Prompt: This video shows a flipbook to make animation. In your own words how is it working? Why does it “trick our eyes” into thinking something is moving?

Goal: This discussion should introduce some key understandings about animation. Students should understand that the key is seeing many pictures in a row that are slightly different. Introduce the vocabulary word “frame” as one of those pictures. Then transition to the fact that soon students will be creating animations of their own.

Vocabulary:

  • Frame: a single image within an animation

We’re going to start learning how to make animations, not just still images. In order to do this we need a way to make our programs draw many pictures a second. Our eyes will blur them together to make it look like smooth motion. To do this, though, we’re going to need to learn an important new tool

Activity (60 min)

Pair Programming: This lesson introduces a challenging new paradigm. Until students are working to improve their projects consider having them pair program. Remember to give students clear instructions on when to switch driver and navigator.

Video: Watch the video introducing the draw loop

Map Level: Briefly point students to the map level following the video. Ask students to use it as a reference as they complete the challenges in today’s activity.

Demo: If you choose, use the provided manipulatives to provide a hands-on demo for exploring how the draw loop and animations are connected.

 Code Studio levels

  • Lesson Overview
  • Video: Introduction to the Draw Loop

The draw function runs the same code over and over in a loop, which is why it’s often called “the draw loop”. This creates an animation effect by changing what is a drawn by a small amount each time the draw function runs. This can be compared to a physical flip book, which can animate an image by changing it slightly on each page.

Misconception Alert!

When the draw loop runs, it does not “clear” out previous drawing, so it will continue to show anything that has not been covered up by the new draw loop. If students do not add a “background” at the beginning of the draw loop, they will still see all the images drawn to the screen previously.

  • Shapes and the Draw Loop
  • The Draw Loop
  • Shapes and the Draw Loop
  • Sprites and the Draw Loop
  • Sprite Properties
  • Sprites and the Draw Loop
  • Animate Your Scene
  • Levels

Wrap Up (10 mins)

Share: Students only need to make small changes to their projects (e.g. shaking a single sprite) but ask them to share with a neighbor or as a full class

Key Understandings: There are many common misconceptions with the draw loop. Make sure students understand the following
  • The draw loop is run after all other code in your program. It does not actually matter where it is located in your program
  • The draw loop is run by Game Lab at a constant frame rate of 30 frames per second. You do not actually need to call the function yourself.
  • The “frames” in Game Lab can be thought of as transparency sheets. Unless you draw a background then all your new shapes or sprites will simply appear on top of your old ones
  • You should only have one draw loop in your program

Prompt: Have students respond to the following prompts

  • What is an animation?
  • Why does the draw loop help us make animations?
  • What are some common errors or mistakes we should look out for as we keep programming with the draw loop?

Review: Return to the resources students saw at the beginning of the lesson (Map Level, Video, physical flip books) and address misconceptions that have arisen in the lesson.

TRY THE CHALLENGE FOR LESSON 7

Lesson 8: Counter Pattern Unplugged

Unplugged

Overview

Students explore the underlying behavior of variables through an unplugged activity. Using notecards and string to simulate variables within a program, students implement a few short programs. Once comfortable with this syntax, students use the same process with sprite properties, tracking a sprite’s progress across the screen.

Purpose

Reasoning about variables can be tricky, especially for new programmers. In this lesson students complete an unplugged activity using physical manipulatives (cards and string) to build a mental model of how information can be stored in a variable and manipulated by a program. This model is then extended to sprite properties, which hold values in a similar way. This lesson introduces syntax and concepts that students will be able to “plug-in” in the following lesson. The mental model presented in this lesson will continue to be useful throughout the unit, even as students begin to write larger and increasingly complex programs.

Objectives

Students will be able to:

  • Describe the connection between updating a sprite’s location properties and sprite movement on the screen.
  • Read and follow the steps of a short program written in pseudocode that manipulates variable values.

Vocabulary

  • Expression – Any valid unit of code that resolves to a value.
  • Variable – A placeholder for a piece of information that can change.

Warm Up (15 mins)

Prompt: In the last lesson, we used the draw loop to make our sprites move around on the screen. What are some other ways we might want to make our sprites move?

In the next few lessons, we’re going to look at lots of ways to have our sprites move around. In order to do that, we need to learn a little bit more about variables and how they work. Today, we’re going to do an activity with variables and sprite properties that will help us to make these types of movement. As we go through the activity, think about how what you’re learning might help you to make your sprites move in the way you want.

Activity (20 mins)

Variables Unplugged Activity

Group: Put students in pairs.

Distribute: Give each pair:

1) A set of labels/values and connectors
2) A single sheet of paper to create their board
3) 2 copies of the activity guide (One for each student.)

Display: Display the rules from the front page of the activity guide and write the first two programs from the second page.

Today we are going to be working in a world of labels, values, and the connectors between them. To simulate this world you’ll be using the scraps of paper and string that I’ve given you. To begin with we’ll need to set up our boards, and afterwards we’ll go over how the commands for this world work.

Demonstrate: Show the class how to divide their boards into 3 sections and label them accordingly, as shown on the first page of the activity guide.

This activity is designed to address many common misconceptions with variables and memory.

Common Misconceptions

  • Variables can have multiple values (They cannot, variables hold at most one value)
  • Variables “remember” old values (They do not, hence old values being removed to the Trash)
  • Variables are connected after a command like “x = y” (This may arise later in the course when students use sprites and will be addressed in great detail. For now students are being forced to create new value cards every time because even for a statement like x = y there is no “connection” between those variables formed)
  • Variables hold expressions (e.g. 1 + 5) (Variables only hold values, expressions are computed beforehand. This is why value cards are only created once students have a single value. Enforce this rule closely)

Support: Students should work through the first two programs as a group, as you reference the steps in the activity guide. As groups feel increasingly comfortable with completing commands themselves encourage groups to independently run each command before comparing their boards with a neighboring pair. The goal is just to make sure everyone has an opportunity to understand the steps of the activity.

Now it’s your turn to try running some of these programs on your own. On the bottom of the page there are two more programs that you can run. For each one you should run the program to find out the ending state of the program. In other words, you want to know what labels are connected to what values. Once you reach the end of each program you can compare your results with a neighboring group. If you don’t agree, then go back though and see if you can find where you lost track.

Support: Students should work in pairs through the two programs on the activity guide. Have a check-in to make sure everyone agrees on the ending state of the program (what labels are connected to what values). If students disagree, reinforce the need to debug when reading code by going back and tracing each step.

Activity 2 (30 mins)

Sprite Properties

Distribute: Sprite Properties in the activity guide if you have not included it on the original activity guide.

Demonstrate: Show students the rules of activity on the activity guide. Work through program 5 as a group, and demonstrate how to make a new sprite card and connect it to both its variable label card and the sprite property cards. Make sure students understand that they should be creating a new sprite card every time they see the createSprite command and should draw their sprites on the grid every time they see the drawSprites command.

Support: Students should work through the last two programs using their manipulatives.

Goal: Students should see that commands such as x = x + 1 will move a sprite in a deliberate way across the screen, as opposed to the random movement they saw in the previous lesson.

Prompt: How did the sprite move across the grid in Program 3? How did the sprite move across the grid in Program 4?

After students have filled out the reflection questions, they should compare with another pair, then discuss as a class.

Wrap Up (10 mins)

Prompt 1: The goal of the discussion is not to have students think of solutions to all the problems, but for them to identify them, priming them for the counter pattern lesson. Their solutions may be vague, but make sure that they understand that continually updating the properties of a sprite in a pattern is essential to simulating motion on the screen.

Prompt 2: Some problems students may see are that the smiley faces remained on the screen, rather than moving, that they could only move left and right or up or down, or that the images stopped after a certain amount of time.

Discussion

Prompt: We saw some clues today of how we might program the types of movement that we want for our sprites. What are some different ideas for how to program movement that you have after this activity? What are some problems that we still need to solve to make the sprite look like it’s moving in the way that you want?

Allow students to brainstorm problems and list them on the board.

Prompt: Choose one or two of these problems and start to think of some ways you could solve this problem.

These are great ideas. In the next lesson, we’re going to look at how we can use some of the things we’ve learned today to make our sprites move in lots of different ways.

Lesson 9: Sprite Movement

Game Lab

Overview

By combining the Draw Loop and the Counter Pattern, students write programs that move sprites across the screen, as well as animate other sprite properties.

Purpose

This lesson combines the Draw Loop that students first saw in Lesson 7 and the Counter Pattern that they learned in Lesson 8 to create programs with purposeful motion. By either incrementing or decrementing sprite properties, such as sprite.x, you can write programs that move sprites in expected patterns, instead of the randomization that we used in the past. The animations that students learn to create in this lesson lay the foundation for all of the animations and games that they will make throughout the rest of the unit.

Objectives

Students will be able to:

  • Use the counter pattern to increment or decrement sprite properties
  • Identify which sprite properties need to be changed, and in what way, to achieve a specific movement

Warm Up (5 minutes)

The purpose of this discussion is to start students thinking about how they might use the various sprite properties they’ve seen so far to make animations with purposeful motion. If students struggle to come up with ideas, you can narrow down the question to specific properties. For example:

  • What would happen to a sprite if you constantly increased its x property?
  • What would happen to a sprite if you constantly increased its y property?
  • What about other properties, or combining multiple properties?

Reviewing Sprite Properties

Prompt: On a piece of scratch paper, list out all of the sprite properties you can think of and what aspect of a sprite they affect.

Discuss: What kinds of animations could you make by combining sprite properties with the counter pattern? Consider both adding and subtracting from properties, or even updating multiple properties at the same time. Record ideas as students share them on the board.

Activity (40 minutes)

Levels: Sprites and Images

Transition: Send students to Code Studio.

Support: Students should be progressing through the levels without stopping in this class. When they have finished the skill building levels they are given the option of which project they wish to extend.

 Code Studio levels

  • Lesson Overview
  • Video: Sprite Movement

Discussion Goals

Students may describe the counter patten in various ways. Make sure that they go beyond just stating the blocks or code that the counter pattern uses. They should understand that the counter pattern allows the programmer to update the value of a variable in a pattern that counts up (or down) on every iteration of the draw loop. This can be used for many different things, such as spinning, growing, shrinking, or timers, but it’s most often used to move sprites across the screen.

When a sprite’s x or y property is updated in a counter pattern, its position changes in a consistent way over time, causing it to move across the screen. Students should be able to explain that movement in an animation is just a change in position, and that changing a sprite’s x position will cause it to move horizontally, and changing a sprite’s y position will cause it to move vertically.

  • Movement with the Counter Pattern
  • The Counter Pattern
  • Animating Sprites
  • Debugging with Watchers
  • Create Your Own Animation
  • Levels

Wrap Up (5 minutes)

Journal

Prompt: Have students reflect on their development of the five practices of CS Discoveries (Problem Solving, Persistence, Creativity, Collaboration, Communication). Choose one of the following prompts as you deem appropriate.

  • Choose one of the five practices in which you believe you demonstrated growth in this lesson. Write something you did that exemplified this practice.
  • Choose one practice you think you can continue to grow in. What’s one thing you’d like to do better?
  • Choose one practice you thought was especially important for the activity we completed today. What made it so important?

TRY THE LESSON 9 CHALLENGES

Lesson 10: Booleans Unplugged

Unplugged

Overview

In this lesson, students are introduced to boolean values and logic, as well as conditional statements. The class starts by playing a simple game of Stand Up, Sit Down in which the boolean (true/false) statements describe personal properties (hair or eye color, clothing type, age, etc). This gets students thinking about how they can frame a property with multiple potential values (such as age) with a binary question.

From there students are provided a group of objects with similar, yet varying, physical properties. With a partner they group those objects based on increasingly complex boolean statements, including compound booleans with AND and OR.

Finally we reveal Conditionals as a tool to make decisions or impact the flow of a program using boolean statements as input.

Objectives

Students will be able to:

  • Evaluate simple and compound boolean statements
  • Use the value of a Boolean statement to determine whether a command should be executed.

Vocabulary

  • Boolean – A single value of either TRUE or FALSE
  • Conditionals – Statements that only run under certain conditions.
  • Expression – Any valid unit of code that resolves to a value.

Warm Up (10 min)

Stand Up, Sit Down

Distribute: Give each student a card and have them answer the following questions on it (feel free to add some of your own)

  1. What is your hair color?
  2. Do you wear glasses or contacts?
  3. What is your favorite number?
  4. What is your favorite color?
  5. What month were you born?
  6. Do you have any siblings?
  7. What is the last digit of your phone number?
  8. What is something about you that people here don’t know and can’t tell by looking at you?

Then collect the cards and shuffle them. To play the game, follow these steps:

For Each Card:

  1. Select a card
  2. Say: I’m going to read the answer to #8 but if it is you, don’t say anything.
  3. Read the answer to #8
  4. Say: Now everyone stand up and we are going to ask some questions with Boolean answers to help determine who this person is. I’m going to say a bunch of statements. If they are true about you stay standing. If they are false sit down.
  5. Translate the answers from #1 to #7 into statements that can either be true or false (See below). The person whose card it is should always answer true.
  6. Because of how numbers 3, 4, 5, and 7 were asked it is likely that some people will still be standing. You will need to revisit these and ask them again in a more narrow fashion such as “My favorite color is purple”.

Example Translation

Question Answer True/False Statement
1) What is your hair color? brown “My hair color is brown.”
2) Do you wear glasses or contacts? yes “I wear glasses or contacts.”
3) What is your favorite number? 12 “My favorite number is greater than 10 and less than 20.”
4) What is your favorite color? purple “My favorite color appears in a sunset.”
5) What month were you born May “I was born in the spring.”
6) Do you have any siblings? yes “I have siblings.”
7) What is the last digit of your phone number? 5 “The last digit of my phone number is prime.”

In English, an “or” is often an “exclusive or” such as “You can have chicken or fish.” In English, you only get to pick one, but with Boolean logic you could have chicken, fish, or both!! For the example person, “I was born in May OR my favorite number is 12” is true. Note that “I was born in May OR my favorite number is 13” is also true.

Play this several times changing the true/false statements you use. Be creative with using or and and. Remind students that the OR means that either part of the statement being true will result in the entire statement being true.

Discuss: the Stand up Sit Down game with students:

  • What kinds of questions did the teacher ask?
  • Were you ever confused about whether you should be standing or sitting? Why?
  • At any point in the game, how many different states could you be in?

Introduce the vocabulary boolean as a description for the kinds of questions we were asking. The defining feature of a Boolean is that it can have only two states – in our game those states were True and False, or Standing and Sitting

Activity (30 min)

Asking the Right Questions

Prompt: Brainstorm places where they’ve seen Boolean values before, either in the class or in the world.

Discuss: Have students share out their answers. Potential answers could include:

  • Binary
  • Flow charts
  • Light switches (and other devices that can be on or off)

Sorting with Booleans

In the game we played, the boolean questions I asked were all based on your properties. Your properties didn’t have to exist in only two states (how many different hair colors are in the room?), but the questions I asked had to split them into two states (how many people in the room have red hair?). We’re going to do similar sorting using the properties of various images.

Group: Organize students into pairs

Set Up: Assign each member of the pair as either True or False.

As students organize their objects into “true” and “false” piles, circulate the room to check on their answers and listen to their discussions.

Distribute: Hand out the cut out images from the worksheet, or provide students with some objects to sort (such as LEGO bricks or candies).

I’m going to read a bunch of binary statements in the form of shape is equal to square or sides is greater than 4, and you are going to sort through their objects to organize them into TRUE and FALSE piles. If students disagree about which pile an object should go into they should first discuss what the property is, what the two outcomes of the binary question are, and then if they still cannot agree they should bring it to the class for a vote.

If you are using the provided cutouts, you can start with the following questions:

Students often struggle with the idea of greater-than or equals to ever being FALSE – they tend to think of those as statements of truth rather than questions of relation.

In this activity we use the language something is equal to something else in order to mirror the code they’ll see later (eg something == something_else), but for students who are struggling with seeing this as a question rather than a statement, you can encourage them to reword the statement by moving the ‘is’ to the beginning, so:

something is equal to something else

becomes

is something equal to something else?
  • sides is equal to 3
  • fill is equal to black
  • corners is less than 1
  • width is equal to height
  • fill is equal to grey AND sides is greater than 4
  • sides is greater than 4 AND less than 7
  • sides is greater than or equal to 5

Conditionals

Goal: After getting used to sorting objects into TRUE and FALSE, we need to introduce students to the concept that Booleans can also be used to control the flow of a program.

A conditional allows us to make a decision based on the outcome of a boolean question (or condition). We actually were implicitly using conditionals in the Stand Up, Sit Down activity because there was an action related to each potential outcome of the boolean. We could have rephrased the instructions as

if statement is true: remain standing else: sit down

Prompt: Select one object from your pile and hold it up.

I’m going to ask you a boolean question about your object and give you an action related to the potentail outcome of the boolean. Figure out what your response should be for your shape and do the correct response.

Informally check student responses as you go through these activities. Have students continue to hold their object up to make it easier for you to assess and allow you to use prompts that test any misconceptions you may have noticed earlier in the activity.

Prompt: Ask students some boolean questions about that single object AND give students something to do if that question is true. For example:

  • If sides is equal to 4, do a dance
  • If pattern is equal to striped, sit down
  • If width is equal to height, hop on one foot

Wrap Up (5 min)

Explicit Conditionals

Goal: Booleans and conditionals are actually something that we use in our everyday lives – we just aren’t usually explicit about it.

Model: As a way to practice thinking explicitly about conditionals, consider dismissing your students using compound booleans and conditionals. For example.

  • If you sit at table four and your hair is brown, you may leave.
  • If your first name starts with A, you may leave.
  • If your shoes are black, you may leave.

Lesson 11: Booleans and Conditionals

Game Lab

Overview

Students start by using booleans to compare the current value of a sprite property with a target value, using that comparison to determine when a sprite has reached a point on the screen, grown to a given size, or otherwise reached a value using the counter pattern. After using booleans directly to investigate the values or sprite properties, students add conditional if statements to write code that responds to those boolean comparisons.

Purpose

This lesson follows closely the booleans model that students first experienced in the Booleans Unplugged lesson. As before, we start with using booleans directly before using booleans to trigger if statements. In the following lesson we will introduce some boolean producing blocks, such as keyDown(), which can be used in place of simple boolean comparisons to write programs that respond to user input.

Objectives

Students will be able to:

  • Use conditionals to react to changes in variables and sprite properties

Vocabulary

  • Boolean Expression – in programming, an expression that evaluates to True or False.
  • If-Statement – The common programming structure that implements “conditional statements”.

Introduced Code

Warm Up (5 min)

Answering Boolean Questions

Goal: At the end of the Boolean Question game from the previous lesson, students began adding conditions to their boolean questions – meaning that if the answer to the question is true, something should happen. Before programming with conditionals, we want to make sure that students have a solid understanding of what booleans really are.

Prompt:

  • How many different numbers are there in the world?
  • How many different words or combination of letters and other characters are there?
  • How many different boolean values are there?

Discuss: Students should realize that the first two questions (numbers and strings), are essentially infinite, but that booleans are limited to two states.

As you begin programming today, you’ll be using booleans to make programs that change their behavior depending on the answer to those boolean questions.

Activity (40 min)

Though seemingly simple, understanding how a boolean statement will evaluate can be difficult given that different programming languages have differing opinions on ‘truthiness’ and ‘falsiness’. In fact, JavaScript (the language used in this course) has two different operators to test boolean equality == and ===.

The double equals operator (==) is pretty generous in determining truthiness, for example each of the following is considered true in JavaScript when using the == operator, but would be false using the === operator:

1 == true;
"1" == true;
5 == "5";
null == undefined;
"" == false;

We use the == operator in this course because it’s more forgiving, but it’s important to be aware that it can sometimes report back truth when you really didn’t intend it to (in which case you might want to use the more strict === operator)

Booleans Plugged

Transition: Send students to Code Studio.

 Code Studio levels

  • Lesson Overview
  • Make a Prediction
  • Video: Booleans

Discussion Goals

Students should be able to explain that a Boolean expression is something that is either true or false, similar to a yes or no question. The more formal way to say this is that Boolean expressions evaluate to either true or false. That means that when the computer processes a Boolean expression, it checks to see whether the expression describes a situation that is true or false, and then uses the value of either true or false wherever the expression is found.

Some examples of Boolean expressions that evaluate to true are 3 > 1 and 4 <= 7, but press students to think of expressions that might be better represented by variables, such as studentAge < 70 or sizeOfClass > 2.

Some examples of Boolean expressions that evaluate to false are 4 == 7schoolName == "Hogwarts", and currentYear < 1000.

  • Boolean Comparison
  • Booleans and Comparison Operators
  • Video: Conditional Statements

Discussion Goals

The broad point of this question is that programmers use if statements when they want the program to run differently in response to different situations. Encourage students to think of particular situations in which this would be the case. For example, they might want their characters to move faster when a “bonus” is in effect, or maybe they want more enemies to appear when the player reaches a certain level. Maybe they want the program to react in some way if a user presses a key or clicks the mouse, or they want a character to change animations if it touches a particular item.

  • Basic Conditionals
  • If Statements
  • Levels

Wrap Up (5 min)

Adding Conditionals

Journal: Think back to all of the programs you’ve written so far; how might you use conditionals to improve one of your programs from past lessons? What condition would you check, and how would you respond to it?

TRY THE LESSON 11 CHALLENGES

Lesson 12: Conditionals and User Input

Game Lab

Overview

Following the introduction to booleans and if statements in the previous lesson, students are introduced to a new block called keyDown() which returns a boolean and can be used in conditionals statements to move sprites around the screen. By the end of this lesson students will have written programs that take keyboard input from the user to control sprites on the screen.

Purpose

One common way conditionals are used is to check for different types of user input especially key presses. Having a way for a user to interact with a program makes it more interesting and dynamic. Without interaction from the user it is very difficult to create a game. Therefore the introduction of conditionals and user inputs for decision making is the first big step toward creating games.

Objectives

Students will be able to:

  • Use conditionals to react to keyboard input
  • Move sprites in response to keyboard input

Introduced Code

Warm Up (5 min)

The goal here isn’t to get into the technical specifics of how programs can take input (students will get to that in the online portion of the lesson), but rather to get students thinking about how allow user input could change the programs they’ve made. Encourage students to think back to Unit 1 and the various computer inputs and outputs they explored then. Which inputs would be most useful for the types of programs they’ve been making?

Taking Input

Discuss: So far all of the programs you’ve written run without any input from the user. How might adding user interaction make your programs more useful, effective, or entertaining? How might a user provide input into your program?

Activity (40 min)

Keyboard Input

Transition: Send students to Code Studio

 Code Studio levels

  • Lesson Overview
  • Keyboard Input
  • Editing Images
  • Keyboard Input

Wrap Up (5 min)

Considering Conditions

Prompt: To get students to continue thinking about how conditionals can be used in programming, prompt them to come up with scenarios in games or programs they use regularly that might be triggered by conditionals.

Discuss: Have students share responses. Student responses might include:

  • If my username and password are correct, log me into Facebook
  • If Pacman has collected all the balls, start the next level
  • If my keyboard or mouse hasn’t moved in 10 minutes, turn on the screensaver

TRY THE LESSON 12 CHALLENGES

Lesson 13: Other Forms of Input

Game Lab

Overview

In this lesson students continue to explore ways to use conditional statements to take user input. In addition to the simple keyDown() command learned yesterday, students will learn about several other keyboard input commands as well as ways to take mouse input.

Purpose

Students have learned how to make simple decisions with conditionals. Sometimes however we want to make decision based on if the condition we asked about originally was false or we want to make a decision based on multiple conditions being true. Thats where else statements and more complex conditionals come in. Else statements are a second statement which is attached to a if statement. Else statements execute when the if statement it is attached to is false. You can think of it as “if something is true do thing 1 else do thing 2.

This concept is introduced alongside several new key and mouse input commands, allowing students to gradually build up programs that input in different ways.

Objectives

Students will be able to:

  • Use an if-else statement to control the flow of a program.
  • Respond to a variety of types of user input.

Vocabulary

  • Conditionals – Statements that only run under certain conditions.

Introduced Code

Warm Up (5 minutes)

Check for Understanding

Today we’ll be picking up today where we left off yesterday – using conditionals to write programs that respond to user input. Let’s refresh what we learned yesterday.

Prompt:

  • What is a Boolean? (eg. a true/false value)
  • What is the relationship between a Boolean and a Conditional? (eg. a conditional asks a Boolean question and runs code if the answer is true)
  • What are some examples of comparison operators that result in a Boolean? (eg. >, <, ==)
  • What is the difference between = and ==? (eg. = is used to assign a value, == is used to check if two values are equal)

Today we’re going to look at a wayto make our conditionals even more powerful, and see some new ways to get user input.

Activity (40 minutes)

If/Else and More Input

Transition: Move the class to Code Studio, and have students complete the prediction level as a class or in small groups, then talk about what they found.

Video: Watch the video as a class and review the discussion questions together.

 Code Studio levels

  • Lesson Overview
  • Predict
  • Video: If/Else Statements

Discussion Goals

Make sure students are thinking of situations in which they want two different things to happen, depending on the situation. For example, they may say that they want one animation if the sprite is moving to the left and a different animation if the sprite is moving to the right. Challenge the students to think about when they would just use an if block, and when an ifelse block is necessary.

  • Input with If-Else
  • If-Else Statements
  • More Input

Wrap Up (5 minutes)

This discussion serves as a brief review and assessment of the new user input commands. As students share out, press them to explain why their choice is better than other, similar choices (mouseDown / mouseWentDown / mouseWentUp). If any commands are missing after all the groups have shared out, elicit the missing ones from the group before moving on.

Prompt: You now have many different ways to detect user input. With a partner, choose three difference user input commands and think of an example of when you might use them. Be ready to share with the class!

TRY THE LESSON 13 CHALLENGES

Lesson 14: Project – Interactive Card

Game Lab | Project

Overview

In this cumulative project for Chapter 1, students plan for and develop an interactive greeting card using all of the programming techniques they’ve learned to this point.

Purpose

This end of chapter assessment is a good place for students to bring together all the pieces they have learned (drawing, variables, sprites, images, conditionals, user input) in one place. Students should still be working with code that is easily readable and doesn’t involve very many high level abstractions. Giving students the opportunity to really be creative after learning all these new concepts will help to engage them further as we head into Chapter 2.

Objectives

Students will be able to:

  • Use conditionals to react to keyboard input or changes in variables / properties
  • Sequence commands to draw in the proper order
  • Apply an iterator pattern to variables or properties in a loop

Warm Up (10 min)

Demo Project Exemplars (Level 2)

Goal: Students see an example of a final project and discuss the different elements that went into making it.

Display: On the projector, run the exemplar for students. Since this is on level 2 of the progression, if its easier for students to do it on their own computers you could do that as well.

 Code Studio levels

  • Interactive Card

Example Project

Run the program a few times and answer the following questions:

1) Which elements appear to use drawing commands?

2) Which elements appear to be Sprites?

3) For each Sprite, which properties are being updated?

4) Where do you see conditionals being used?

5) Are there elements that you don’t understand?

Discuss: Have students share their observations and analyses of the exemplar.

Encourage the class to consider that there are multiple approaches to programming anything, but that there may be clues as to how something was created. In particular, when they are sharing their thoughts ask them to specify the following :

  • Clues that suggest a Sprite was used
  • Clues that suggest a conditional was used
  • Clues that suggest an iterator pattern was used

Display: Show students the rubric. Review the different components of the rubric with them to make sure they understand the components of the project.

Activity (2 days)

Unplugged: Interactive Card Planning

Goal: Students should plan out what they want to create before they head to the computer so that once they get to the computer they are just executing the plan.

Distribute: Hand out the project guide to students. This is the tool students will use to scope out their projects before getting onto the computers. Give students some time to brainstorm the type of card they want to create and who the recipient will be.

Steps

1) The first layer of the interactive card is a background drawn with just the commands in the Drawing drawer. The front of the Activity Guide provides a grid for students to lay out their background, a reference table of drawing commands, and an area for students to take notes and write pseudocode.

2) Next students think through the Sprites they’ll need, filling out a table of each Sprite’s label, images, and properties

3) Finally students consider the conditionals they’ll need in order to make their card interactive.

Levels: Implementing Interactive Card (Level 3 – 7)

 Transition: Once students have completed their planning sheet, it’s time to head to the Code.org website for Lesson 10. The short level sequence asks students to complete each element of their project.

 Code Studio levels

  • Making an Interactive Card

Your Interactive Card

In the next few levels, you’ll be completing your own interactive card. Here are some examples to give you some ideas. Don’t forget to look at the code to see how they work.

Examples

                        

Distribute: Give each student a copy of the peer review guide.

Students should spend 15 minutes reviewing the other student’s card and filling out the peer review guide.

Iterate – Update Code

Circulate: Students should complete the peer review guide’s back side and decide how to respond to the feedback they were given. They should then use that feedback to improve their cards.

Reflect

Using the rubric, students should assess their own project before submitting it.

 Send students to Code Studio to complete their reflection on their attitudes toward computer science. Although their answers are anonymous, the aggregated data will be available to you once at least five students have completed the survey.

Wrap Up (10 minutes)

Sharing Cards

Goal: Students share their creations with the class.

Share: Find a way for students to share their cards with each other, and with the intended recipient. It will likely be helpful to use the share link for the project so that students can share the project with other students.

 

LESSON 1

Goal: Before you leave class today you will be introduced to CodeHS and how Karel the Dog can be given a set of instructions to perform a simple task.

  1. Sign up for www.codehs.com. HERE IS HOW:
    1. Go to: codehs.com
    2. Class code: AD980
    3. If prompted, use your school Google account to sign in
    4. Acclimate yourself! Look around!
  2. Complete the CodeHS Pretest/Survey–get it from your teacher
  3. Complete the JavaScript Knowledge & Skills Pretest–get it from your teacher
  4. Log into CodeHS and do Lesson 1
    1. Get the Meet Karel the Dog handout from your teacher
    2. Watch 1.1.1 Introduction to Programming With Karel
    3. Do:  1.1.3 Our First Karel Program–change it up a little to experiment!
    4. Do:  1.1.4 Your First Karel Program–show me when you are done
    5. Do: 1.1.5 Short Stack–show me when you are done
    6. If time permits: discover what else Karel can do by checking out the Cheat Sheet.
  5. FYI: CodeHS Online Textbook–use this as a resource
  6. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily): What can Karel teach us about computing?

LESSON 2

GOAL: You will learn about Karel’s ‘World’ and the ways that Karel can interact with it.

VOCAB:

Term Definition
lowerCamelCase lowerCamelCase is a naming convention where the first letter is lower case, and each subsequent start of a word is upper case.
World A “world” or “Karel World” is a grid that karel lives in.
Karel Karel is a dog who listens to your commands.
Command A command is an instruction you can give to Karel.

DO THIS IN ORDER:

  1. REVIEW:
    1. Get the Karel Commands handout from your teacher and complete it–raise your hand when you are done
    2. Do this online quiz:  1.1.2 Quiz: Karel Commands
  2. Watch:  1.2.1 More Basic Karel
  3. Do:  1.2.3 Tennis Ball Square–experiment with it!
  4. Do:  1.2.4 Make a Tower–show me when you are done
  5. Do:  1.2.5 Pyramid of Karel–show me when you are done
  6. If time permits: discover what else Karel can do by checking out the Cheat Sheet.
  7. FYI: CodeHS Online Textbook–use this as a resource
  8. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. How can we make Karel turn right, even though Karel doesn’t know a turn right command?
    2. What is a street in Karel’s world?
    3. What is an avenue in Karel’s world?
    4. What are the directions Karel can face?

LESSON 3

GOAL: Karel can learn new words or commands through the use of functions. This is called defining a functions. Defining functions has syntax rules.

VOCAB:

Term Definition
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:Do:  1.2.2 More Basic Karel Quiz
  2. WATCH:  1.3.1 Karel Can’t Turn Right
  3. Do:  1.3.3 Tower and Turn Right–experiment!
  4. Do:  1.3.4 Slide Karel–show me
  5. Do:  1.3.5 Fireman Karel
  6. Did you get it?!  1.3.6 Karel Turns Right Badge
  7. If time permits: Rewrite previous exercises using functions.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What are functions?
    2. Why are functions useful?
    3. Write out a function for an everyday activity that you perform, for example:
      function eatSandwich(){bring sandwich to mouth;bite down;chew;}

LESSON 4

GOAL: Functions are used to teach Karel a word or command. Using functions allow us to break down our program into smaller pieces and make it easier to understand.

VOCAB:

Term Definition
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.
Curly Bracket An open curly bracket is { and a close curly bracket is }
Function body The part of a function that contains the commands

DO THE FOLLOWING IN THIS ORDER:

  1. REVIEW:
    1. Get the Karel Can’t Turn Right handout from your teacher & complete it–show me before moving on
    2. Get the What’s Wrong with This Function? handout from your teacher & complete it–show me before moving on
    3. Do:  1.3.2 Karel Can’t Turn Right Quiz
  2. Do the Dancing with Functions class activity–get the handout from your teacher
  3. Watch:  1.4.1 Functions in Karel
  4. Do & experiment:  1.4.3 Turn Around
  5. Do & show me:  1.4.4 Pancakes
  6. Do & show me:  1.4.5 Mario Karel
  7. If time permits: Create an original Sandbox program that defines and calls a minimum of 4 (four) functions.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. Why are functions important?
    2. How do functions change how we think about our programs?

LESSON 4–FINISH

  1. Dancing with Functions
  2. Finish & Show me 1.4.4 & 1.4.5

LESSON 5

GOAL: You will gain a deeper understanding of functions. You will be able to explain the importance of writing readable code, and you will be able to analyze and compare the readability of different programs. You will be able to use the start function to make your programs more readable.

VOCAB:

Term Definition
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Define a Function Defining a function means to teach the computer a new command and explain what it should do when receiving that command.
Call a Function Calling a function actually gives the command, so the computer will run the code for that function.
Start Function This is the function that is called when you click run.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Get the Naming Functions handout from your teacher & complete it–show me before continuing
    2. Get the What’s Wrong with the Functions? handout from your teacher & complete it–show me before continuing
    3. Do:  1.4.2 Functions in Karel Quiz
  2. Watch:  1.5.1 The Start Function
  3. What did you notice about the format and syntax of calling functions?
  4. Do & experiment:  1.5.3 Tower with Start Function
  5. Do & show me:  1.5.4 Pancakes with Start
  6. You are going to create your own Karel program using the Sandbox feature. Its important that before you edit Karel worlds that you have an objective for what you would like Karel to do. Write out what the objective is first, then develop a solution for it in your Word Online file for this class.
  7. Create a new Karel program using the Sandbox feature:
    1. Click on the Sandbox tab.
    2. Let’s create a new Karel program together by naming it MyFirstKarelProgram and choosing KAREL for the type of program.
    3. Click on Edit Karel Worlds and try to:
      • Move Karel’s start row and column
      • Changing the width and height
      • Changing Karel’s start direction
      • Adding and Removing a Ball
      • Adding and Removing a Wall
      • Moving Karel
  8. Extra Credit Opportunities:
    1. Create a poster that lists the rules or Do/Don’ts for defining and calling functions.
    2. My Day in Functions–Think about your typical school day. What are the functions that you routinely perform that can be defined like a function? Write out what your day looks like by writing at least 3 functions and calling them throughout your day.Examplefunction start(){snapChat();takeNotes();}function snapChat(){openApp();takePhoto();send();}function takeNotes(){takeOutPaper();writeVocabWords();}

LESSON 6

GOAL: Students will be able to…

  1. Break a large problem down into smaller pieces
  2. Write methods to solve each smaller problem
  3. Solve a complicated problem using Top Down Design
  4. Identify good and poor decomposition

VOCAB:

  1. Break Down (Decompose)–Breaking down (decomposing) your code is splitting it into more functions.
  2. Read Like a Story–Programs that “Read like a story” have good decomposition and make the code easy to follow.
  3. Indentation–Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.
  4. Decomposition–Decomposition is breaking your program into smaller parts.
  5. Top Down Design–Top down design is a method for breaking our program down into smaller parts.

DO THE FOLLOWING IN THIS ORDER:

  1. REVIEW: 1.5.2 The Start Function Quiz
  2. Do the Decomposition Activity–Get the handout from your teacher
    1. Write the instructions for making a peanut butter and jelly sandwich
    2. Using a student volunteer, execute student instructions to make a sandwich as a computer would. Did it work the way you thought it would?
    3. You are not allowed to interpret what the instructions mean, only to execute the instructions literally.
  3. Watch: 1.6.1 Top Down Design and Decomposition in Karel
  4. Using the graphic organizer shown in the video, break down or decompose the process of making a PB & J. Notice how the process can be broken down into functions such as putIngredientOnKnife() or spreadTheIngredients().
  5. 1.6.3 Hurdle Karel
    1. Look at the example of exercise Hurdle Karel. Without running the program, predict what Karel will do and write the pseudocode:  1.6.3 Hurdle Karel
    2. Write your pseudocode on the board so that the class may follow it as the example is run.
    3. Run Hurdle Karel and compare your pseudocode to the actual result of the program. 1.6.3 Hurdle Karel
    4. What did you notice?
  6. 1.6.4 The Two Towers
    1. Notice the starting world and the result world of Karel.
    2. Identify the objective, the preconditions, postconditions.
    3. It might be helpful to move Karel to avenue (2, 1) so that you can see where Karel will begin when she begins to build the Tower.
    4. Once Karel is moved to (2, 1), write the first commands for the buildTower() function.
    5. Be sure to use good style in writing functions by indenting code and using proper syntax.
    6. Before getting with a partner to build the start function, you will need two helper functions.
    7. Once the buildTower() function is built as a class, break into pairs and begin to build the start function.
  7. If time permits:
    1. Decompose more complicated tasks from your every day life
    2. Decompose the same problem into multiple solutions with various levels of granularity
      1. For example, Making a PB&J could have the following answers
        1. Take bread and PB out of cabinet, take Jelly out of fridge, combine ingredients into sandwich
        2. Raise arm, Grasp cabinet handle, Pull handle to open door, etc… (this is probably more granular than you would like, but hopefully you understand the idea!)
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING (respond to just 2 out of the following 7 questions) in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What did you learn in this lesson/day?
    2. How did you learn it?
    3. What was your “a-ha!” moment? What sparked it?
    4. When did you get stuck? How did you get “unstuck”?
    5. Why is it useful to be able to break down problems into smaller sub problems?
    6. Is this strategy only useful for programming? What other situations might we apply this method of problem solving to?
    7. Describe how you helped Karel break down a big problem into a smaller problem today. How did that affect how you wrote your code?

LESSON 7

GOAL: Students will be able to…

  1. Explain the preconditions and postconditions of a function
  2. Create clear and readable comments in their code that help the reader understand the code
  3. Explain the purpose of comments
VOCAB: 
  1. Programming Style–The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
  2. Comment–A message in your code that explains what is going on.
  3. Precondition–Assumptions we make about what must be true before the function is called.
  4. PostconditionWhat should be true after the function is called

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do:  1.6.2 Top Down Design and Decomposition Quiz
    2. Do the Planning Programs 1 activity–get it from your teacher–work with a partner
  2. Click on example  1.7.3 Hurdle Karel. Read the code in green. What purpose do you think the code serves in the program? Does the code in green affect the program?
    1. Can you identify the direction and avenue that Karel faces in the starting world? This is known is as a precondition.
    2. Can you identify the direction and avenue that Karel faces in the result world? Also note the amount of balls in the tower and how many were built. This is known is as a postcondition.
    3. Complete The Two Towers + Comments exercise in pairs or individually.
    4. Because of your hard work with defining and calling functions, you have unlocked the super powers of Karel. These super powers are the ability to turn right and turn around without having to define it as a separate function.
    5. Examine the example in Hurdle Karel (with SuperKarel).
      *Students complete The Two Towers + Super Karel using the turnRight() command.
  3. If time permits: Go back through previous Karel exercises and add pre and postconditions to your code
  4. FYI: CodeHS Online Textbook–use this as a resource
  5. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What are the two types of comments?
    2. What is the benefit of using comments?
    3. Are there times you wouldn’t write a comment? Why?

LESSON 8

GOAL: Students will be able to…

  1. Write programs that use SuperKarel instead of Karel
  2. Utilize the new toolbox of commands that SuperKarel provides over Karel
  3. Read documentation to understand how to use a library (SuperKarel is an example of this)

VOCAB:

SuperKarel SuperKarel is like Karel but already knows how to turnRight() and turnAround()

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.7.2 Commenting Your Code Quiz
    2. Do the Commenting Code activity–get the handout from your teacher
  2. Click on example  1.8.3 Hurdle Karel (with SuperKarel). Read the code in green. What purpose do you think the code serves in the program? Does the code in green affect the program?
  3. Watch 1.8.1 Super Karel video
  4. Do 1.8.4 The Two Towers + SuperKarel & show me
  5.  1.8.5 Super Karel Badge Did you get it?!
  6. If time permits: Go back through previous Karel exercises and add pre and postconditions to your code
  7. FYI: CodeHS Online Textbook–use this as a resource
  8. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. How is SuperKarel different from Karel?
    2. Where can you go to read about all of SuperKarel’s built in commands?

LESSON 9

GOAL: Students will be able to…

  1. Create for loops to repeat code a fixed number of times
  2. Explain when a for loop would be a useful tool
  3. Utilize for loops to write programs that would be difficult / impossible without loops

VOCAB:

  1. Loop–A loop is a way to repeat code in your program.
  2. For Loop–A for loop lets us repeat code a fixed number of times.
  3. Control Structure–A control structure lets us change the flow of the code.
  4. Curly Bracket–An open curly bracket is { and a close curly bracket is }
  5. Parentheses–( and )

DO THE FOLLOWING IN ORDER:

  1. REVIEW: 1.8.2 Super Karel Quiz
  2. Think about this: create a function that will enable Karel to climb one stair. What if Karel needed to climb 100 stairs? What part of your code would you need to repeat? What part of you code will be repeated? How many times will the code be repeated?
  3. Watch  1.9.1 For Loops
  4. Look over  1.9.3 Repeated Move
    1. Notice how the condition inside the parentheses works by stating that:
      1. The variable i is initialized, or started at the value of 0.
      2. The i < 9 determines the point that the loop will stop.
      3. i++ increments, or increases the value of i.
      4. All parts in the condition within the parentheses are separated by a semi-colon, expect the last statement
  5. Run 1.9.3 Repeated Move and  1.9.4 Put Down Tennis Balls example and note how the value of i at the bottom of the screen increases and keeps track of how many times Karel has looped through the statement.
    1. Experiment with the code by changing the value of i.
  6. Do  1.9.5 Take ’em All
  7. Do  1.9.6 Dizzy Karel
  8. Do  1.9.7 For Loop Square
  9. Do  1.9.8 Lots of Hurdles
  10. If time permits: In the example exercises Repeated Move & Put Down Tennis Balls, write functions using for loops
  11. FYI: CodeHS Online Textbook–use this as a resource
  12. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. For loops are a part of all programming languages, why do you think that is?
    2. Why are for loops useful?
    3. For loops extend the limits of what we can do with our programs. What is one Karel program you could write with a for loop that you couldn’t do without one?
    4. Think of and write down three real-life scenarios that could use a for loop.
    5. What did you learn in this lesson/day? How did you learn it? What was your “a-ha!” moment? What sparked it?When did you get stuck? How did you get “unstuck”?

LESSON 10

GOAL: Students will be able to…

  1. Use conditions to gather information about Karel’s world (is the front clear, is Karel facing north, etc)
  2. Create if statements to only execute code if a certain condition is true

VOCAB: 

  1. ConditionA condition is code that you put inside an if statement or while-loop.
  2. If Statement–An if statement lets you ask a question to the program and only run code if the answer is true.
  3. Control Structure–A control structure lets us change the flow of the code.
  4. Parentheses–( and )

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.9.2 For Loops Quiz
    2. Complete the For Loops handout individually or in pairs.
  2. What determines what time you will go to bed? What determines when you will ask for help in class? What determines when you eat birthday cake? Point out the condition in each of the If statements on the board. Identify what code is executed if the condition is true.
  3. Watch  1.10.1 If Statements
  4. Look at  1.10.3 If Statements by comparing and contrasting what occurs to Karel when the start function is initialized.
    1. Why do you think Karel crashed when the start function is initialized?
  5. Examine 1.10.4 Safe Take Ball example in pairs or individually.
  6. Do & show me  1.10.5 Is There a Ball? individually or in pairs.
  7. FYI: CodeHS Online Textbook–use this as a resource
  8. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. Write if statements for real life scenarios. Examples include:
if (zombiesPresent()){
    runAndHide();
}

if (favoriteSongOnPandora()){
    dance();
}

LESSON 11

GOAL: Students will be able to…

  1. Explain the purpose of an If/Else statement
  2. Create If/Else statements to solve new types of problems
  3. Identify when an If/Else statement is appropriate to be used

VOCAB: 

  1. If Statement–An if statement lets you ask a question to the program and only run code if the answer is true.
  2. If Else Statement–Control structure that lets us do either one section of code or another depending on a test.
  3. Control Structure–A control structure lets us change the flow of the code.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.10.2 If Statements Quiz
    2. Complete the To If, Or Not To If handout individually or in pairs.
  2. Do Now: Your best friend and you agree to go to the theater to see the latest action hero movie. When you arrive however, you are saddened to find out that it has sold out. What activity might you do instead? If that activity can’t be done, what else might you and your friend do to have a fun evening?
    1. Record them as an if/else statement with correct syntax.
    2. What did you notice about what you wrote and how the code is executed?
    3. What might your default command be (goHome(), goToBed(), etc)?
  3. Watch 1.11.1 If/Else Statements
  4. Explore  1.11.3 If/Else Statements and 1.11.4 One Ball in Each Spot exercises.
  5. Do & show me 1.11.5 Right Side Up & 1.11.6 Right vs. Left Square individually or in pairs.
  6. FYI: CodeHS Online Textbook–use this as a resource
  7. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
  1. Explain the difference between an if statement and an if/else statement.
  2. Give an example of a problem that Karel would need an if statement to solve
  3. Give an example of a problem that Karel would need an if/else statement to solve
  4. Why are if/else statements useful?
  5. Write out real life scenarios that would involve if/else statements. For example:
if(favoriteSongOnPandora()){
    dance();
} else {
    doHomework();
}

FINISH:

LESSON 11

GOAL: Students will be able to…

  1. Explain the purpose of an If/Else statement
  2. Create If/Else statements to solve new types of problems
  3. Identify when an If/Else statement is appropriate to be used

VOCAB: 

  1. If Statement–An if statement lets you ask a question to the program and only run code if the answer is true.
  2. If Else Statement–Control structure that lets us do either one section of code or another depending on a test.
  3. Control Structure–A control structure lets us change the flow of the code.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.10.2 If Statements Quiz
    2. Complete the To If, Or Not To If handout individually or in pairs.
  2. Do Now: Your best friend and you agree to go to the theater to see the latest action hero movie. When you arrive however, you are saddened to find out that it has sold out. What activity might you do instead? If that activity can’t be done, what else might you and your friend do to have a fun evening?
    1. Record them as an if/else statement with correct syntax.
    2. What did you notice about what you wrote and how the code is executed?
    3. What might your default command be (goHome(), goToBed(), etc)?
  3. Watch 1.11.1 If/Else Statements
  4. Explore  1.11.3 If/Else Statements and 1.11.4 One Ball in Each Spot exercises.
  5. Do & show me 1.11.5 Right Side Up & 1.11.6 Right vs. Left Square individually or in pairs.
  6. FYI: CodeHS Online Textbook–use this as a resource
  7. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
  1. Explain the difference between an if statement and an if/else statement.
  2. Give an example of a problem that Karel would need an if statement to solve
  3. Give an example of a problem that Karel would need an if/else statement to solve
  4. Why are if/else statements useful?
  5. Write out real life scenarios that would involve if/else statements. For example:
if(favoriteSongOnPandora()){
    dance();
} else {
    doHomework();
}

BEGIN:

LESSON 12

GOAL: Students will be able to…

  1. Explain the purpose of a while loop
  2. Create while loops to repeat code while a condition is true
  3. Utilize while loops to solve new types of problems
  4. Test their solutions on different Karel worlds

VOCAB: 

Loop A loop is a way to repeat code in your program.
While Loop Lets us repeat code as long as something is true.
Condition A condition is code that you put inside an if statement or while-loop.
Control Structure A control structure lets us change the flow of the code.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.11.2 If/Else Statements Quiz
    2. What do we know about for loops?
    3. In what situation would for loops not be helpful?
  2. Do Now: Write instructions that will allow me (the teacher) to clap at the same time as walking. Use a conditional statement or for loop if necessary.
    1. Be prepared to share your instructions with the class.
    2. I will execute the commands exactly as they are read.
  3. Introducing the concept of a while loop: we wanted to achieve clapping while we were walking, thus we can use a while loop.
  4. Watch 1.12.1 While Loops in Karel
  5. Get a copy of While loops (student-version) and begin working on the activity.
    1. After you have completed the activity in the handout, how would a for loop would be written for the activity? How reusable would our code be if Karel’s world became a 4×2 world, or a 5×5 world?
      It is important to remember about writing reusable code, so that if Karel’s world changed, how useful would a for loop be if Karel’s world decreased to 4×2 or a 5×5?
  6. 1.12.3 Move to Wall demonstrates this concept by changing Karel’s world from 6×6, to a 8×8 and 10×10.
  7. Go over the Why Use Loops? handout–get it from your teacher.
  8. SHOW ME WHEN YOU ARE DONE: Work individually or in pairs to complete:
    1.  1.12.4 Follow The Yellow Ball Road
    2. 1.12.5 Lay Row of Tennis Balls: Get the Fence Post Handout from your teacher to possibly help you
    3. 1.12.6 Big Tower
  9. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  10. FYI: CodeHS Online Textbook–use this as a resource
  11. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What is the difference between for loops and while loops?
    2. Provide an example of when you would use each loop.

FINISH:

LESSON 12

GOAL: Students will be able to…

  1. Explain the purpose of a while loop
  2. Create while loops to repeat code while a condition is true
  3. Utilize while loops to solve new types of problems
  4. Test their solutions on different Karel worlds

VOCAB: 

Loop A loop is a way to repeat code in your program.
While Loop Lets us repeat code as long as something is true.
Condition A condition is code that you put inside an if statement or while-loop.
Control Structure A control structure lets us change the flow of the code.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do  1.11.2 If/Else Statements Quiz
    2. What do we know about for loops?
    3. In what situation would for loops not be helpful?
  2. Do Now: Write instructions that will allow me (the teacher) to clap at the same time as walking. Use a conditional statement or for loop if necessary.
    1. Be prepared to share your instructions with the class.
    2. I will execute the commands exactly as they are read.
  3. Introducing the concept of a while loop: we wanted to achieve clapping while we were walking, thus we can use a while loop.
  4. Watch 1.12.1 While Loops in Karel
  5. Get a copy of While loops (student-version) and begin working on the activity.
    1. After you have completed the activity in the handout, how would a for loop would be written for the activity? How reusable would our code be if Karel’s world became a 4×2 world, or a 5×5 world?
      It is important to remember about writing reusable code, so that if Karel’s world changed, how useful would a for loop be if Karel’s world decreased to 4×2 or a 5×5?
  6. 1.12.3 Move to Wall demonstrates this concept by changing Karel’s world from 6×6, to a 8×8 and 10×10.
  7. Go over the Why Use Loops? handout–get it from your teacher.
  8. SHOW ME WHEN YOU ARE DONE: Work individually or in pairs to complete:
    1.  1.12.4 Follow The Yellow Ball Road
    2. 1.12.5 Lay Row of Tennis Balls: Get the Fence Post Handout from your teacher to possibly help you
    3. 1.12.6 Big Tower
  9. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  10. FYI: CodeHS Online Textbook–use this as a resource
  11. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. What is the difference between for loops and while loops?
    2. Provide an example of when you would use each loop.

LESSON 13

GOAL: Students will be able to…

  1. Identify the different control structures we can use to modify the flow of control through a program
  2. Combine control structures to solve complicated problems
  3. Choose the proper control structure for a given problem

VOCAB:

Control Structure A control structure lets us change the flow of the code.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.12.2 While Loops in Karel Quiz
    2. What are the different ways we have been able to control Karel in the past week?
  2. What are the differences and similarities of the for, if, and while loops?
  3. Examine the Control Structures Flowchart:
  4. Watch 1.13.1 Control Structures Example video
  5. Walk through 1.13.3 Cleanup Karel by exploring what might happen if the last if statement is removed from the program.
  6. Work individually or in pairs to complete  1.13.4 Random Hurdles
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. When would you use each of the different control structures?

LESSON 14

GOAL: Students will be able to…

  1. Analyze a solution to a problem and explain why it works
  2. Use control structures to create general solutions that work on all Karel worlds

VOCAB:

Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Decomposition Decomposition is breaking your program into smaller parts.
Control Structure A control structure lets us change the flow of the code.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.13.2 Control Structures Example Quiz
    2. What are the different ways we have been able to control Karel in the past week?
  2. Do Now: Get it from your teacher
  3. Share answers for the Do Now exercise from students and test their code in the editor of the Move Tennis Ball Stack example.
    1. What are the reasons why a particular control structure was chosen by students?
    2. If a student example contains bugs, inquire solutions from the class and test it together.
    3. Look at the correct solution. Take note that code was tested in increments.
  4. Watch 1.14.1 More Karel Examples and Testing
  5. Explore the 1.14.3 Move Tennis Ball Stack solution as well as the 1.14.4 Climbing Karel example.
  6. Teacher will show you a preview of Tower Builder exercise in the Karel Challenges section.
    1. What control structures you might use and in which order? Record your answer on the white board in the classroom.
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1.  When would you use each of the different control structures?
    2. Explain in your own words how to make Karel solve the Move Tennis Ball Stack problem.
    3. Explain in your own words how to make Karel solve the Climbing Karel problem.

LESSON 15

GOAL: Students will be able to…

  1. Explain why it is important to indent code
  2. Identify proper indentation
  3. Modify a program to have proper indentation
  4. Write programs with proper indentation

VOCAB:

Indentation Indentation is the visual structure of how your code is laid out. It uses tabs to organize code into a hierarchy.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.

DO THE FOLLOWING IN ORDER:

  1. REVIEW:
    1. Do 1.14.2 Quiz: Which Control Structure?
    2. Which is easier to read: indented code or unindented code?
    3. What are some things we can do in our code to have good programming style?
  2. Do Now: Get it from your teacher–Share your solutions with a partner to compare and contrast the various results.
    1. Think about English rules regarding indentation and new paragraphs.
    2. What purpose does indentation serve in reading and writing?
    3. How do these rules apply to programming?
  3. Watch  1.15.1 How to Indent Your Code
  4. Examine 1.15.3 Dance and Clean Karel. How can you use the gray dotted lines to guide your indentation?
  5. Work individually or in pairs to complete  1.15.4 Diagonal and 1.15.5 Staircase–SHOW ME
  6. 1.15.6 Karel Exercises Badge–Did you get it? SHOW ME
  7. Be sure to use debugging strategies so that your code is reusable in all of Karel’s worlds.
  8. FYI: CodeHS Online Textbook–use this as a resource
  9. BEFORE YOU LEAVE, WRITE ABOUT THE FOLLOWING in the Word Online file named Web Apps & Coding for this class (you will write in this file daily):
    1. How is indentation used in programs? What are the rules for proper indentation?
    2. Why is it important to use proper indentation?
    3. Why is good programming style important?
    4. Write pseudocode for either Diagonal or Staircase using correct indentation.
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What is the first thing you should do when approaching a new Karel challenge?
  2. Why is it important to write out your solution in your own words before starting to code?
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What is pseudocode? How can writing your solution out in pseudocode help you write your program?
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What should you do if you get stuck?
It’s time to put it all together! You have learned all of Karel’s abilities, and have practiced writing programs to solve Karel problems. In this unit, you will synthesize all of the skills and concepts learned in the Karel unit to solve increasingly challenging Karel puzzles.

TEST DAY–Group up! You cannot move on until EVERYONE in your group is finished with an activity!

Objective

Students will be able to…
* Define a problem in their own words and plan out a solution to the problem
* Break a large problem down into smaller pieces and solve each of the pieces, then use these solutions as building blocks to solve the larger problem
* Utilize the proper control structures to create general solutions that solve multiple Karel worlds
* Write clear and readable code using control structures, functions, decomposition, and comments

Vocabulary

These are the key terms for this lesson.

Term Definition
Break Down (Decompose) Breaking down (decomposing) your code is splitting it into more functions.
Read Like a Story Programs that “Read like a story” have good decomposition and make the code easy to follow.
Programming Style The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works.
Comment A message in your code that explains what is going on.
Decomposition Decomposition is breaking your program into smaller parts.
Fencepost Problem A problem when using a while loop where you forget one action at the beginning or the end.

Suggestions:

  • Review the idea of pseudocode. Plan out your solution to a problem first in plain language, then pseudocode, before ever typing out your code. Your solution should read out like a story, then you can code each step of the story.
  • Remember you will need to solve the challenge for every Karel world provided, not just the starter world.
  • Sometimes it’s best to learn best by doing. The Karel Challenges synthesize skills and concepts learned from the entire unit. You will likely need multiple class periods to solve all of the challenges.
  • Some of the challenges are very tricky, but the longer you spend trying, the more rewarding it is when you finally solve the problem. Growth mindset is very important here. Many solutions will seem promising at first, but then will end up being incorrect. This is an opportunity to learn what was wrong, and try again with a better plan. Most of the time, the first solution you try to code will not end up being correct, and that’s okay! The bugs you run into are chances to learn from your mistakes.

Activities

These are all the activities included in the lesson.

Discussion Questions:

Answer the following at the top of your Word Online file for this class:

  1. What are some tools that can help you debug your programs?

Objective

Students will be able to…
* Write a JavaScript program by typing commands with proper syntax in the start function
* Write a program that prints out a message to the user

Activities

These are all the activities included in the lesson.

Activity

3.1.1 Hello World

Video

3.1.2 Hello World Quiz

Quiz SHOW ME

3.1.3 Hello World

Example

3.1.4 Your Name and Hobby

Exercise SHOW ME

Objective

Students will be able to…
* Explain what variables are and what they are used for
* Create their own variables
* Print out the values stored in variables

Activities

These are all the activities included in the lesson.

Activity

3.2.1 Variables

Video

3.2.2 Variables Quiz

Quiz PRINT QUIZPRO

3.2.3 Basic Variables

Example

3.2.4 Apples and Oranges

Exercise REVIEW FOR CLASS

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.


User input is a cornerstone of any interactive program. In this lesson we learn how we can allow the user to input information into our programs. This will make our programs much more interactive and useful.

Objective

Students will be able to…
* Create programs that ask the user for input
* Store user input in variables and print it back to the user
* Choose the proper input function to use depending on the type of information needed

Activities

These are all the activities included in the lesson.

Activity

3.3.1 User Input

Video

3.3.2 User Input Quiz

Quiz PRINT QUIZPRO

3.3.3 Basic User Input

Example

3.3.4 Grocery Store

Exercise REVIEW FOR CLASS

Lesson: 3.4 Basic Math in JavaScript

Section:


Computers are excellent machines for performing mathematical operations. In this lesson we learn about the different mathematical operators we can use to perform mathematical computations, and we create useful programs that compute useful information for the user.

Objective

Students will be able to…
* Describe the different mathematical operators we can use in programs
* Create programs that use basic math to compute useful things
* Create programs that take in user input, do simple computations with the input, and produce useful output

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Lesson: 3.4 Basic Math in JavaScript

Section:


Computers are excellent machines for performing mathematical operations. In this lesson we learn about the different mathematical operators we can use to perform mathematical computations, and we create useful programs that compute useful information for the user.

Objective

Students will be able to…
* Describe the different mathematical operators we can use in programs
* Create programs that use basic math to compute useful things
* Create programs that take in user input, do simple computations with the input, and produce useful output

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Lesson: 3.5 Using Graphics in JavaScript

Section:


The basics of creating graphics objects to a screen relies on setting the type, shape, size, position, and color before on the artist’s canvas before adding to the screen. Using the geometric concepts, and the concept of getWidth() and getHeight(), multiple graphic objects can be created in JavaScript.

Objective

Students will be able to…
* Create graphical JavaScript programs that draw shapes on the canvas
* Locate points on the graphics canvas using (x, y) coordinates

Activities

These are all the activities included in the lesson.

Activity

3.5.1 Graphics

Video

3.5.2 JavaScript Graphics Quiz

Quiz PRINT QUIZPRO

3.5.3 Graphics Hello World

Example

3.5.4 Blue Circle

Example

3.5.5 Red Rectangle

Example

3.5.6 8 Ball

Example

3.5.7 French Flag

Exercise REVIEW FOR CLASS

3.5.8 Snowman

Exercise REVIEW FOR CLASS

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.


Booleans refer to a value that is either true or false. Named after English-born mathematician, philosopher and logician, George Boole, Booleans are used to test whether a condition is true or false.

Objective

Students will be able to…

  • Create boolean variables to represent meaningful yes/no values
  • Print out the value of a boolean variable

Activities

These are all the activities included in the lesson.

Activity

4.1.1 Booleans

Video

4.1.2 Booleans Quiz

Quiz SHOW ME

4.1.3 First Boolean

Example

4.1.4 Do You Have a Dog?

Exercise SHOW ME

Logical operators allow us to connect or modify Boolean expressions. Three logical operators are the !, ||, && characters.
! = NOT
|| = OR
&& = AND
Logical operators can be used in combination.

With these logical operators, we can construct logical statements such as “I go to sleep when I am tired OR it’s after 9pm”, “I wear flip flops when I am outside AND it is NOT raining”

Objective

Students will be able to…
* Describe the meaning and usage of each logical operator: OR (||), AND (&&), and NOT (!)
* Construct logical statements using boolean variables and logical operators

Activities

These are all the activities included in the lesson.

Activity

4.2.1 Logical Operators

Video

4.2.2 Logical Operators Quiz

Quiz SHOW ME

4.2.3 Light Switch

Example

4.2.4 President

Example

4.2.5 Wasting Time

Example

4.2.6 Can You Graduate?

Exercise SHOW ME

4.2.7 School’s Out

Exercise SHOW ME

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.


Comparison operators let us compare two values. Using comparison operators in programming is similar to math in that less than <, greater than >, less than or equal to <=, and greater than or equal to >= are the same. The differences are that operators for equal to are == and not equal are !=. Using comparison operators allows our program to make decisions.

Objective

Students will be able to…
* Explain the meaning of each of the comparison operators (<, <=, >, >=, ==, !=)
* Create programs using the comparison operators to compare values
* Predict the boolean result of comparing two values
* Print out the boolean result of comparing values

Activities

These are all the activities included in the lesson.

Activity

4.3.1 Comparison Operators

Video

4.3.2 Comparison Operators Quiz

Quiz SHOW ME

4.3.3 Voting Age

Example

4.3.4 Grade Range

Example

4.3.5 Rolling Dice

Exercise SHOW ME

4.3.6 All Star

Exercise SHOW ME

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

SEND ME AN EMAIL MESSAGE TODAY TELLING ME THE SCORE ON YOUR QUIZ AND THE EXERCISES YOU WERE ABLE TO COMPLETE.

Lesson: 4.4 If Statements

Section:


JavaScript uses if statements as a way to make decisions and execute specific code. If statements are helpful in writing code that can be used in different situations.

Objective

Students will be able to…
* Explain the purpose of if statements
* Create their own if statements to selective choose which code is executed in their programs

Activities

These are all the activities included in the lesson.

Activity

4.4.1 If Statements

Video

4.4.2 If Statements Quiz

Quiz SHOW ME

4.4.3 Negative Numbers

Example

4.4.4 Great Names

Example

4.4.5 Even and Odd

Example

4.4.6 Secret Password

Example

4.4.7 Teenagers

Exercise SHOW ME

4.4.8 Stop Light

Exercise SHOW ME

4.4.9 Conditionals Badge

Badge

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.5 For Loops in JavaScript

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration

Activities

These are all the activities included in the lesson.

Activity

4.5.1 Basic For Loop

Video

4.5.2 For Loops Quiz

Quiz SHOW ME

4.5.3 For Loop

Example

4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.5 For Loops in JavaScript

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration

Activities

These are all the activities included in the lesson.

Activity

4.5.1 Basic For Loop

Video

4.5.2 For Loops Quiz

Quiz SHOW ME

4.5.3 For Loop

Example

4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.5 For Loops in JavaScript

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Create for loops in JavaScript
* Explain the purpose of for loops
* Utilize for loops to avoid typing out repeated code
* Use the loop counter i inside the for loop code to do something different on each iteration

Activities

These are all the activities included in the lesson.

Activity

4.5.1 Basic For Loop

Video

4.5.2 For Loops Quiz

Quiz SHOW ME

4.5.3 For Loop

Example

4.5.4 Chalkboard

Exercise SHOW ME

4.5.5 The Worm

Exercise SHOW ME

4.5.6 Caterpillar

Exercise SHOW ME
 Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

 Lesson: 4.6 General For Loops

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…
* Explain the three parts of the for loop (initialization statement, test statement, increment statement)
* Create for loops that iterate differently than the basic for loop structure (ie count by twos or count backwards)

Activities

These are all the activities included in the lesson.

Activity

4.6.1 General For Loop

Video

4.6.2 General For Loop Quiz

Quiz SHOW ME

4.6.3 Countdown

Example

4.6.4 Count By Twos

Example

4.6.5 Count By Sevens

Exercise SHOW ME

4.6.6 Powers of Two

Exercise SHOW ME

Open the Google Doc for this class. In your own words at the TOP of the Doc, explain what you learned today and how it can help you write programs.

SANDBOX–create a new programs that uses at least one WHILE LOOP and IF ELSE statement.  Include at least 2 of your own functions. Show me.

Lesson: 4.7 For Loop Practice

Section:


For loops in Javascript are written and executed in the same manner as the Karel exercises. However, now we explore in more detail the other parts of the loop besides using it as just a counter. We can modify the initialization statement, test statement, and increment statement. The caterpillar problem is one of the more challenging problems because it has students combine several concepts. You will probably spend a week on for loops.

Objective

Students will be able to…

  • Explain the purpose of for loops
  • Create for loops to solve increasingly challenging problems
  • Create nested for loops: for loops inside of for loops

Activities

These are all the activities included in the lesson.

Activity

4.7.1 For Loop Examples

Video

4.7.2 For Loop Examples Quiz

Quiz SHOW ME

4.7.3 For Loop Sum

Example

4.7.4 Better Sum

Exercise SHOW ME

4.7.5 Factorial

Exercise SHOW ME

4.7.6 All Dice Values

Exercise SHOW ME

A randomizer gives a program the appearance of randomly generated number, color or attribute in a program. The Randomizer can be used in conjunction with nextInt(low, high)nextBoolean()nextFloat(low, high), and nextColor(). It can be utilized to make programs more interesting and engaging for users. With this lesson, students will be made to see how randomization can enhance a program and used in combination with various control structures.

Objective

Students will be able to…

  • Explain why random numbers are a useful part of computer programs
  • Create random values in a program
  • Create programs that do something different on each run depending on random values that are generated
  • Utilize the DOCS for the Randomizer class in order to learn how to generate random values

Activities

These are all the activities included in the lesson.

Activity

4.8.1 Random Numbers

Video

4.8.2 Random Numbers Quiz

Quiz SHOW ME

4.8.3 Rolling a Die

Example

4.8.4 Flipping a Coin

Example

4.8.5 Lots of Dice

Exercise SHOW ME

4.8.6 Random Color Square

Exercise SHOW ME

4.8.7 Randomizer Badge

Badge

 


In this lesson students will explore while loops and JavaScript variables. This combines the ideas of creating variables, updating variables throughout a loop, and determining the correct ending condition. Note that the fibonacci problem is a bit tricky, so you may want to discuss the idea of that on the board or projector.

Objective

Students will be able to…

  • Explain the purpose of a while loop
  • Create while loops to repeat code while a condition is true
  • Utilize while loops to solve new types of problems

Activities

These are all the activities included in the lesson.

Activity

4.9.1 While Loops

Video

4.9.2 While Loops Quiz

Quiz SHOW ME

4.9.3 While Loop Countdown

Example

4.9.4 Inventory

Exercise SHOW ME

4.9.5 Fibonacci

Exercise SHOW ME

Lesson: 4.10 Loop and a Half

Section:


A Loop and a Half is a specific way to write a while loop with the condition being true. Inside the loop, you compare to a SENTINEL value to break out of the loop. This structure often allows you to write less code.

Objective

Students will be able to…

  • Explain the how the loop-and-a-half structure is different from a traditional while loop
  • Explain what an infinite loop is
  • Explain what the break statement does
  • Create programs that use the loop-and-a-half structure to repeat code until a SENTINEL is met, causing the program to break out of the loop

Activities

These are all the activities included in the lesson.

Activity

4.10.1 Loop and a Half

Video

4.10.2 Loop and a Half Quiz

Quiz SHOW ME

4.10.3 Adding Up Numbers

Example

4.10.4 Snake Eyes

Exercise SHOW ME

4.10.5 Better Password Prompt

Exercise SHOW ME

4.10.6 Looper Badge

Badge

 

Lesson: 5.1 Functions and Parameters 1

Section:


In this lesson we start to introduce functions and parameters. Functions and parameters are some of the key building blocks for all programs. Here we just introduce functions with parameters, but functions with return values comes next. This way students can just focus on the “input” to the function rather than the input and output at the same time. Students will start writing console programs to try simple functions with parameters and will then write graphics programs.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create their own JavaScript functions
  • Utilize their JavaScript functions to solve simple problems
  • Create functions that take in parameters as input

Activities

These are all the activities included in the lesson.

Activity

5.1.1 Functions and Parameters 1

Video

5.1.2 Functions and Parameters Quiz 1

Quiz SHOW ME

5.1.3 Double Number

Example

5.1.4 Square

Exercise SHOW ME

5.1.5 Triple

Exercise SHOW ME

Lesson: 5.2 Functions and Parameters 2

Section:


Functions and parameters are some of the key building blocks for all programs. Here we just introduce functions with parameters, but functions with return values comes later. This way students can just focus on the “input” to the function rather than the input and output at the same time. Students will start writing console programs to try simple functions with parameters and will then write graphics programs.

This lesson covers functions with multiple parameters. Students will write functions that take in multiple parameters as input and print out output.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create their own JavaScript functions
  • Utilize their JavaScript functions to solve simple problems
  • Create functions that take in multiple parameters as input, and use print statements for output

Activities

These are all the activities included in the lesson.

Activity
5.2.1 Functions and Parameters 2 Video
5.2.2 Functions and Parameters Quiz 2 Quiz SHOW ME
5.2.3 Sum Function Example
5.2.4 Area of Triangle Exercise SHOW ME
5.2.5 Height in Meters Exercise

Lesson: 5.3 Functions and Parameters 3

Section:


Functions and parameters are some of the key building blocks for all programs. Here we just introduce functions with parameters, but functions with return values comes later. This way students can just focus on the “input” to the function rather than the input and output at the same time. Students will start writing console programs to try simple functions with parameters and will then write graphics programs.

This lesson covers functions with multiple parameters that create graphics as output. This is very useful, since creating several different graphical objects involves writing the same code over and over again (set the size, set the color, set the location, etc). Functions and parameters allow us to write the code once and then use parameters to create the different graphical objects and add them to the canvas.

Objective

Students will be able to…

  • Explain the purpose of functions
  • Create their own JavaScript functions
  • Utilize their JavaScript functions to simplify their graphics programs
  • Identify repeated code that can be simplified with functions and parameters
  • Create functions that take in multiple parameters as input, and create graphics as output

Activities

These are all the activities included in the lesson.

Activity

5.3.1 Functions and Parameters 3

Video

5.3.2 Functions and Parameters Quiz 3

Quiz SHOW ME

5.3.3 Draw Circles

Example

5.3.4 Horizontal Lines

Exercise SHOW ME

5.3.5 Graphics Stop Light

Exercise SHOW ME

5.3.6 Pool Table

Exercise SHOW ME

5.3.7 Parameters Badge

Badge

Lesson: 5.4 Functions and Return Values 1

Section:


Think of a function like assigning a task. A return value is giving you the completed work.
This allows you to write functions that do some work for you and send back the result.
Parameters are like inputs into the function, and the return value is output.

Objective

Students will be able to…

  • Explain the purpose of returning a value from a function.
  • Create functions that return values.
  • Create programs that call functions with return values and store the result for later use.

Activities

These are all the activities included in the lesson.

Activity

5.4.1 Functions and Return Values 1

Video

5.4.2 Functions and Return Values Quiz

Quiz SHOW ME

5.4.3 Double Number

Example

5.4.4 Square with Return Values

Exercise SHOW ME

5.4.5 Triple with Return Values

Exercise SHOW ME

Lesson: 5.5 Functions and Return Values 2

Section:


Think of a function like assigning a task. A return value is giving you the completed work.
This allows you to write functions that do some work for you and send back the result.
Parameters are like inputs into the function, and the return value is output.

Objective

Students will be able to…

  • Explain the purpose of returning a value from a function.
  • Create functions that return values.
  • Create programs that call functions with return values and use the return values to solve a higher order problem.

Activities

These are all the activities included in the lesson.

Activity

5.5.1 Functions and Return Values 2

Video

5.5.2 Functions and Return Values Quiz 2

Quiz SHOW ME

5.5.3 Return Values

Example

5.5.4 Is It Even?

Exercise SHOW ME

5.5.5 Max

Exercise SHOW ME

Lesson: 5.6 Local Variables and Scope

Section:


In this lesson we explore the scoping of a variable, which is where the variable is “defined” or where it exists. In this unit getting students to define and explain the concept themselves is key.

Objective

Students will be able to…

  • Identify the scope of a variable
  • Identify which variables are in scope at a given point in a program

Activities

These are all the activities included in the lesson.

Activity

5.6.1 Local Variables and Scope

Video

5.6.2 Local Variables and Scope Quiz

Quiz SHOW ME

5.6.3 Return Values

Example

5.6.4 Local Variables

Exercise SHOW ME

5.6.5 JavaScript Exercises Badge

Badge

Lesson: 6.1 Unit Test

Section:


Use your knowledge of basic Javascript to create some fun programs! Students will create their own Ghost drawings from Pac-Man, a Guessing Game, and a drawing of their own choosing. This will allow students to get creative with their code to show what they have learned.

Objective

Students will be able to…

  • Synthesize the skills and concepts from the JavaScript and Graphics, JavaScript Control Structures, and the Functions and Parameters units to solve increasingly difficult programming challenges
  • Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
  • Create helpful comments with preconditions and postconditions to help the reader understand the code
  • Find and fix bugs in large programs

Activities

These are all the activities included in the lesson.

Activity

6.1.1 Ghosts

Challenge SHOW ME

6.1.2 Guessing Game

Challenge SHOW ME

6.1.3 Draw Something

Challenge SHOW ME

6.1.4 Basic JS Unit Quiz

Quiz SHOW ME

6.1.5 JavaScript Challenges Badge

Badge

Lesson: 7.1 Timers

Section:


In this lesson students will be introduced to the concept of using timers for animation. Now instead of having graphics programs that stay the same, the content changes every time the timer runs. The first program students will see is a moving ball, so discussing this with the class as a demo on the projector is very useful.

Objective

Students will be able to…

  • Explain in their own words how animation works
  • Create animation in programs using the setTimer function
  • Explain what a callback function is

Activities

These are all the activities included in the lesson.

Activity

7.1.1 Timers

Video

7.1.2 Timers Quiz

Quiz PRINT QUIZPRO

7.1.3 Moving Ball

Example

7.1.4 Magic 8 Ball

Example

7.1.5 Crazy Ball

Exercise REVIEW FOR CLASS

 Lesson: 7.2 Random Circles

Section:


In this lesson we’ll look at more examples with timers and start making more interesting animations. Students will use timers and the Randomizer to create animations on the canvas.

Objective

Students will be able to…

  • Create programs with timers to create increasingly challenging animations
  • Analyze existing programs and explain how they create animations
  • Utilize the Randomizer to generate random events in their animations

 Lesson: 7.3 Random Ghosts

Section:


In this lesson students now use timers in combination with the other ideas they have learned, including more graphics as well as coordinate math to create different objects. The random ghosts serves as a fun example to show how you can modify things once you have the basic building blocks in place.

Objective

Students will be able to…

  • Explain the general workflow of creating an animation program
  • Analyze animation programs and identify similarities and differences
  • Create increasingly challenging animations using timers, graphics, and the Randomizer

Activities

These are all the activities included in the lesson.

Activity
7.3.1 Example: Random Ghosts Video
7.3.2 Random Ghosts Quiz Quiz PRINT QUIZPRO
7.3.3 Random Ghosts Example
7.3.4 Random Fireworks Example
7.3.5 Circle Wall Exercise REVIEW FOR CLASS

 Lesson: 7.4 Bouncing Ball

Section:


This lesson builds on our use of timers and utilizes if statements inside timers to dynamically change what the animations are doing. The exercises build on the Bouncing Ball example.

Objective

Students will be able to…

  • Explain the general workflow of creating an animation program
  • Analyze animation programs and identify similarities and differences
  • Create increasingly challenging animations using timers, graphics, and the Randomizer

Activities

These are all the activities included in the lesson.

Activity

7.4.1 Example: Bouncing Ball

Video

7.4.2 Bouncing Ball Quiz

Quiz PRINT QUIZPRO

7.4.3 Bouncing Ball

Example

7.4.4 Hotspot Ball

Exercise REVIEW FOR CLASS

7.4.5 Trail

Exercise REVIEW FOR CLASS

7.4.6 Animator Badge

Badge

 Lesson: 7.5 Mouse Events: Mouse Clicked

Section:


Here we introduce a way the students can get input from the mouse using mouse clicked. We keep some of the same building blocks by showing examples with circles and ghosts, and then the student programs prompt them to use this new idea in combination with tracking overall program state.

Objective

Students will be able to…

  • Describe how events are different than timers
  • Use mouse click events to create programs that respond to user clicks

 

Lesson: 7.6 Mouse Events: Mouse Moved

Section:


Mouse events capture actions performed by the mouse. This allows you to create interactive programs including basic games. This lesson explains how to use mouse events to make some interactive animations.

Objective

Students will be able to…

  • Explain how events are different from timers.
  • Create interactive programs that use events to respond to the mouse moving.

Activities

These are all the activities included in the lesson.

Activity

7.6.1 Mouse Events: Mouse Moved

Video

7.6.2 Mouse Events: Mouse Moved Quiz

Quiz PRINT QUIZPRO

7.6.3 Simple Painting

Example

7.6.4 Colorful Drag to Paint

Example

7.6.5 Coordinates

Exercise REVIEW FOR CLASS

7.6.6 Target

Exercise REVIEW FOR CLASS

 

 Lesson: 7.7 Drawing Lines

Section:


In this lesson we continue to use user input via the mouse.

Objective

Students will be able to…

  • Explain how events are different from timers.
  • Create interactive programs that use events to respond to the mouse moving.

Activities

These are all the activities included in the lesson.

Activity

7.7.1 Example: Drawing Lines

Video

7.7.2 Drawing Lines Quiz

Quiz PRINT QUIZPRO

7.7.3 Drawing Lines

Example

7.7.4 Leash

Exercise REVIEW FOR CLASS

7.7.5 Advanced Animator Badge

Badge

 

 Lesson: 7.8 Key Events

Section:


Keyboard events capture when the user presses keys on the keyboard. This allows you to write programs that take input from the keyboard to change what is happening in the program.

Objective

Students will be able to…

  • Explain how events are different from timers.
  • Create interactive programs that use events to respond to the keyboard input.

Activities

These are all the activities included in the lesson.

Activity

7.8.1 Key Events

Video

7.8.2 Key Events Quiz

Quiz PRINT QUIZPRO

7.8.3 Keyboard Square

Example

7.8.4 Basic Snake

Exercise REVIEW FOR CLASS

 Lesson: 7.9 Crazy Ball Game

Section:


In this lesson students will create a drag and drop program by combining lots of the ideas from this section.

Objective

Students will be able to…

  • Synthesize the skills and concepts learned in the Animation and Games unit to create a full game step by step.

 

Lesson: 8.1 Breakout

Section:


Students will learn to make their very own Breakout video game! This lesson brings together everything they have learned in the module and allow them to show it off in a complete game.

Objective

Students will be able to…
* Synthesize the skills and concepts from Java Script Control Structures, Functions and Parameters, and Animation and Games to create their very own Breakout game from scratch!
* Break down a large problem into smaller parts using Top Down Design, and solve each of these smaller parts using functions
* Create helpful comments with preconditions and postconditions to help the reader understand the code
* Find and fix bugs in large programs

Activities

These are all the activities included in the lesson.

CREATE YOUR OWN PROGRAM IN CODEHS.

YOU HAVE TWO CLASSES TO FINISH THIS

INCLUDE THE FOLLOWING:

  • 2 questions
  • base the response from the computer on the answers to the 2 questions
  • include multicolored graphics

 

CREATE YOUR OWN PROGRAM IN CODEHS.

YOU HAVE TODAY TO FINISH THIS–YOU WILL SHOW THE CLASS NEXT TIME

INCLUDE THE FOLLOWING:

  • 2 questions
  • base the response from the computer on the answers to the 2 questions
  • include multicolored graphics

 

FINISH YOUR CODEHS PROGRAM

 

KAREL UNIT EXAM

GOAL: Today you will get acquainted with the Unity Editor. You will be introduced to importing assets, the viewer windows, and how to navigate within the Unity Editor.

DO NOW:

  1. WATCH THIS BEGINNER’S ADVICE VIDEO. It offers 3 pieces of advice:
    1. Keep it simple: Set realistic goals for your first game.
    2. Play to your strengths: Let your game type reflect your talents and resources.
    3. Be persistent: Just seeing your project through will put you ahead of the pack.
  2. Complete the following tutorials, using the Unity Editor:
    1. READ: Learning the Interface Tutorial–http://docs.unity3d.com/Manual/LearningtheInterface.html
    2. WATCH THIS: Unity Interface
  3. Get into Unity on your computer
  4. Under Learn, click on & do 01. Play & Edit Mode, then do 02. Game Objects & Components
  5. In your Word Online file for this class, write about what you learned today.

GOAL: Today you will get acquainted with the Unity Editor. You will be introduced to importing assets, the viewer windows, and how to navigate within the Unity Editor.

DO NOW:

  1. WATCH THIS: The Scene View
  2. Get into Unity on your computer & do the following Basic Tutorials:
    1. 03. Tweaking Components
    2. 04. Prefab Power
  3. Click Tutorial Projects & do: Roll-a-ball–SHOW ME WHEN IT IS DONE
  4. In your Word Online file write about what you learned today and let me know how Unity is working for you.

Roll-a-ball tutorial

Create a simple rolling ball game that teaches you many of the principles of working with Unity.

1. Environment and Player

2. Camera and Play Area

2D GAME KIT

3D GAME KIT 

or continue working on the 2D Game Kit

Roll a ball

2D

3D

We will have a Unity viewing party next class

Roll a ball

2D

3D

UNITY VIEWING PARTY

  1. WATCH THIS: The Game View
  2. WATCH THIS: The Project Window
  3. WATCH THIS: The Hierarchy Window

GOAL: Today you will get acquainted with the Unity Editor. You will be introduced to importing assets, the viewer windows, and how to navigate within the Unity Editor.

  1. Get into Unity:
    1. Type Unity in the lower left of your screen
    2. Click Unity
    3. Choose New Project
    4. Click Create New Project
  2. Editor Basics: http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/editor-basics
    1. Do the video–your screen will look slightly different–that is ok
    2. When saving–go to your ONEDRIVE–create a folder named UnityProjects and save the new file as TwitchProject in the UnityProjects folder
  3. In your Word Online file for this class, write about what you learned today.

GOAL: Create your Game Developers Journal & a Game Modification Task Sheet & Plan

  1. Open & read this: Game Developer’s Journal–You need to do this!!! Here is what you should do for your journal today:
    1. Enter at least 5 core game (i.e. product) ideas to be considered for your final Capstone Project. These do not need to be very detailed ideas, just a few sentences to capture the main game concept. Later, one of these ideas will be developed and delivered as your final Capstone Project submission.
  2. Download CandyCrush Saga onto any game play device. The game can be found at http://candycrushplayfreegame.com
  3. Play the game long enough to understand the directions and the overall objectives of the game.
  4. Produce a Game Modification Task Sheet document by identifying the following:
    1. What platform is used to play the game?
    2. What is the objective of the game?
    3. What three things do you like about the game?
    4. What three things do you not like about the game?
    5. List three reasons why you think this game is popular and successful.
  5. Based on your own observations, create a written plan for modifying the game. This document will  serve as your Game Modification Plan. Your plan should include the following:
    1. Re-write the main goal of the game.
    2. Describe how you would improve the game. Be as specific as possible!
    3. List three reasons why your ideas may not have been implemented by the original designers.
    4. List three reasons why you think players would like your changes.
    5. List three reasons why these changes would be difficult to implement.
    6. Here is how it will be scored

Unit 3–Intro to Programming

Chapter 1: Intro to Programming

Big Questions:

  • Why do we need algorithms?
  • How is designing an algorithm to solve a problem different from other kinds of problem solving?
  • How do you design a solution for a problem so that it is programmable?
  • What does it mean to be a “creative” programmer?
  • How do programmers collaborate?

Lesson 1: The Need for Programming Languages

Objectives: Students will be able to………

  • Assess the clarity of a set of instructions expressed in human language
  • Create a set of instructions in human language for building a simple LEGO block arrangement
  • Identify connections between the ability to program and the ability to solve problems
  • Describe the ambiguities inherent in human language and the ways programming languages seek to remove those ambiguities

DO NOW:

  1. Go to www.code.org
  2. Join my class: http://studio.code.org/join/BQFGGY
  3. Watch this Ted Talk–You Should Learn to Code
  4. Get the Activity Guide–LEGO Instructions
  5. With 5-10 minutes remaing, respond to the following in your Word Online file for this class:
    1. Consider the algorithm you designed for today’s activity. Identify two instances where there may be multiple ways to interpret your instructions and suggest improvements that could be made to improve their clarity.
    2. Describe the features of a programming language that make it different from the language you are used to using in everyday life. Explain why a programming language must be created in this way.

Unit 3–Intro to Programming

Chapter 1: Intro to Programming

Big Questions:

  • Why do we need algorithms?
  • How is designing an algorithm to solve a problem different from other kinds of problem solving?
  • How do you design a solution for a problem so that it is programmable?
  • What does it mean to be a “creative” programmer?
  • How do programmers collaborate?

Lesson 2: The Need for Algorithms

Objectives: Students will be able to………

  • Trace programs written in the “Human Machine Language”
  • Develop an algorithm to find the smallest playing card in a row of cards
  • Express an algorithm in the “Human Machine Language”
  • Identify the properties of sequencing, selection and iteration the “Human Machine Language”
  • Evaluate the correctness of algorithms expressed in the “Human Machine Language”

DO NOW:

  1. Go to www.code.org & log in
  2. Intro
    1. Recall the lessons learned about language. Yesterday’s activity focused on the inherent difficulties of trying to express precise processes with written language. We arrived at a few conclusions…
      1. We need to agree on a set of commands and exactly what terms mean
      2. The fewer commands we have, the easier it is to agree
      3. We want to know what are the “primitive” operations – the most basic set of operations that will allow us to do most of the tasks that the situation requires.
      • Language is important, but there is another part to programming. Once you have a well defined language you need to apply it to problems.
      • The art (and science) of using a well-defined language of primitive operations to solve problems is the art and science of algorithms.
      • The CS Principles definition of algorithm is: Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages.
      • One way to think of the study of algorithms is that it is the study of processes — how can you use a small set of instructions to clearly and correctly define process that will solve some problem?
      • Yesterday, with the LEGO blocks, you also attempted to design an algorithm. Any time you are trying to write a precise set of instructions for a process to solve a problem you are designing an algorithm.
      • Today we’re going to get into algorithms a little more deeply.
  3. Activity 1: It goes without saying that in a Computer Science class we are concerned with not just any processes, but computational processes – ones that can be executed by a computer – which have specific sets of constraints. We often get started thinking about algorithms and computational processes by trying to rigorously act them out ourselves as a sort of “Human Machine”. When acting as a machine, we can keep the limitations of a computer in mind. In this activity you’re going to pretend that you are a “Human Machine” that operates on playing cards on the table.
    1. Get the Human Machine Minimum Card Algorithm Activity Guide
    2. Get clear on the task, rules, instructions
    3. With a partner act out an algorithm
    4. Write down the steps
    5. As you are working you might ask yourself questions like:
      • “How do you know when to stop?”
      • “Do your instructions state where and how to start?”
      • “Is it clear where to put cards back down after you’ve picked them up?”
    6. You and your partner share with the class.
    7. As we look at these algorithms you came up with, we can see they are not all the same. However, there are common things that you are all making the human machine do and commonalities in some of your instructions. Can we define a language of common Human Machine commands for moving cards around? What are the commands or actions most of these instructions have in common?
    8. What are some commands?
    9. Write them down or group them based on type.
    10. Here are some examples:
      1. SHIFT (hand) – some form of shifting hands one position down the row left or right
      2. MOVE (hand) – some form of moving a hand directly to a particular card based on its position in the list or to the position of one of the other hands.
      3. COMPARE – some way to compare cards and do something based on the result like: “if card in right hand is less than card in left hand then…”
      4. GO TO LINE – some way to jump to an earlier or later line in the program
      5. PICK CARD UP/PUT CARD DOWN – some way to do this that also makes clear where to put a card back down. Typically something like: “Put right hand card down into the right-most open space in the row of cards”
  4. Activity 2: We have just identified a set of primitive commands that we can use to operate on a set of cards. To be very concrete let’s formalize this into a language. Get the Activity Guide – Human Machine Language – Activity Guide
    1. Read the first page. Be sure you understand the instructions and setup.
    2. Get with the partner you had before
    3. You should try to figure out the example programs with a partner, making use of the code reference guide.
    4. One partner reads, the other acts as the human machine.
    5. You should jot notes about what the program does.
    6. Do you understand how the language works?
    7. Let’s take turns describing each one.
    8. Go to the last problem
      1. Did you understand it?
      2. What would be your solution?
    9. This problem we identified with the last example speaks to the art and science of algorithm design and what can make it so interesting. The question is: can we fix the problem without adding more commands to the language? If we can fix a problem without extending the language, that’s a good thing. We can focus our attention on designing algorithms given these constraints. Let’s try to write FindMin using the Human Machine Language…
      1. First, what’s different about the problem setup for the Human Machine Language?
          1. This might be very challenging at first since the problem setup is slightly different
          2. The problem now has different initial assumptions.
            1. All cards are face up
            2. Card positions have numbers
            3. Don’t need to pick up cards or put them down
            4. There is actually no way to move cards at all – only hands
            5. The ending state is well defined – left hand touching the min card.
      2. Now use the Human Machine Language to write the algorithm for finding the min card.
        1. NOTE: You can just write the code, or you can use the cutout strips of the commands and write values into the boxes.
        2. Work with your partner.
      3. Share solutions to Find Min with the Human Machine Language
        1. You and your partner get together with another group to compare solutions.
        2. Each group should test out the other group’s code by acting as the human machine.
        3. During the comparison note any differences in people’s approach.
      4. It’s okay if you can’t quite finish before the period is over. This activity continues in the next lesson anyway.
  5. This is a first experience in evaluating some code.
  6. It’s important to actually try out a solution to identify any potential errors.
  7. It’s also important to see that people’s programs are different
  8. With 5-10 minutes remaining, respond to the following in your Word Online file for this class:
    1. Connect algorithms to programming.
      1. Yesterday we discussed the need for a programming language. Today we came up with our own programming language and used it to implement an algorithm. The CSP definition of algorithm is: “a precise sequence of instructions for processes that can be executed by a computer and are implemented using programming languages.”
      2. Notice two things about algorithms and programming…
        1. Different algorithms can be developed to solve the same problem–Even though you were all trying to solve the same problem (find min) as a class we came up with different methods for doing it. We would say we came up with different algorithms.
        2. Different code can be written to implement the same algorithm–This is sometimes surprising to newcomers. When writing “code” (even with with the human machine language) two people trying to write code to implement the same algorithm may very easily code it differently.
      3. These two facts – Different algorithms can be developed to solve the same problem and different code can be written to implement the same algorithm – embody art of programming and what makes programming so fun, engaging and creative. In programming, just like art, we strive to make beautiful things:
        1. A beautiful algorithm is an elegant and clever idea for how to solve a problem.
        2. A beautiful program is an elegant use of whatever language structures are provided to make the algorithm actually work on a computer.
  9. Foreshadow: tomorrow we’ll try some other algorithms in the human machine language.

Unit 3, Chapter 1, Lesson 3: Creativity in Algorithms

Objectives

Students will be able to:

  1. Develop an algorithm to solve a new problem with playing cards
  2. Express an algorithm in the Human Machine Language
  3. Identify Sequencing, Selection and Iteration in a program written the Human Machine Language
  4. Describe the properties of the Human Machine Language that make it a “low level” language.

Getting Started

Conclusions from Find Min

  1. Finish FindMin from last class–remember you can use the scissors to cut the commands or your can just write them in pencil
  2. Before moving on to the activity you should all have some solution to FindMin written in the Human Machine Language.

Creativity in Algorithms

  1. One thing about algorithms is that once you know a few, and know how they work, you can combine them (or slightly modify them) to solve new problems. Creativity in algorithms comes from figuring out clever ways to solve problems by developing a process that could be executed by a machine.
  2. We study algorithms and care about them because in programming the techniques and mechanics of certain processes come up over and over and over again. So it’s worth knowing a few so you don’t have to reinvent the wheel.
  3. For example, you just wrote an algorithm to find the smallest card in a row of cards. Is it hard to modify that exact same strategy to find the max card?
  4. Today we’ll challenge you with a few more problems that will require you to get creative!

Activity

Adding SWAP to Human Machine Language

  1. Get the – Human Machine Language – Part 2: Min To Front – Activity Guide from your teacher
  2. Get with a partner
  3. Review the first page of the activity guide and the addition of the “swap” command.
  4. Do the example program
  5. Review the example: Here is the solution–END STATE: the order of the cards has been reversed. It does this by first moving the right hand to the end of the list, then shifting each hand progressively toward the middle of the orw, swapping cards each time. The program stops once the hands have crossed over each other (by checking if RHPos<LHPos)

Challenge: Min-to-Front

  1. The challenge is to find the min card and swap it to the front of the list, keeping the order of the rest of the cards the same.
  2. As you work try to solve the problem in pieces.
  3. Here are some suggestions:
    1. IDEA: Solve move-to-front first
      1. Remember: “Algorithms can be combined to make new algorithms”
      2. You should know a solution to find min, so you can put that out of mind for a minute.
      3. Start by assuming that you’ve found the min card, and writing a procedure to move some card to the front of the list, by swapping.
      4. Once you’ve got that you can tack the two together
    2. IDEA: Don’t be afraid to invent a completely new algorithm
      1. get creative – you might need or want to invent a whole new algorithm

Wrap Up

  1. Learning to program is really learning how to think in terms of algorithms and processes. And it can be really fun and addicting. It also can make you feel like you have magical powers.
  2. In the next lesson we’ll start writing programs that a real machine (not a human machine) will execute. But since programming is really about thinking and problem solving your “human machine” skills will come in handy – reasoning about program is also about reasoning about what a computer can and cannot do, and what the given language you’re using let’s you and doesn’t let you do.
  3. If you didn’t want to learn how to program before, perhaps this video will change your mind… You Should Learn to Program: Christian Genco at TEDxSMU – Video

Unit 3, Chapter 1, Lesson 4: Using Simple Commands

Overview

Students use the App Lab programming environment for the first time and become acquainted with the turtle. The chief problem is to find the most “efficient” way to draw an image of a 3×3 grid using a limited set of only 4 commands.

Objectives

Students will be able to:

  • Use App Lab to write programs that create simple drawings with “turtle graphics.”
  • Create a program with a partner following the pair programming model
  • Explain different ways one might measure the efficiency of a program.

Vocab

  • Pair Programming – A method of programming in which two programmers write code using a single computer. One programmer in the “driver” role uses the mouse and keyboard to actually write the code while a second acts as a “navigator”, keeping track of the big picture, catching errors, and making suggestions. Programmers switch roles frequently and communicate throughout the process.
  • Turtle Programming – a classic method for learning programming with commands to control movement and drawing of an on-screen robot called a “turtle”. The turtle hearkens back to early implementations in which children programmed a physical robot whose dome-like shape was reminiscent of a turtle.

New Code

Getting Started–Transitioning to Programming

  1.  Think back over the human machine language lessons we just completed. In your Word Online file for this class, write down some advice or encouragement you’d give to students in next year’s class before they complete those same lessons. What attitudes or skills will be important?
  2. Share your advice.
  3. SPOILER ALERT: This advice isn’t really for next year’s students, but for all of you! Today we’re going to begin programming on the computer, and while that’s obviously different from the human machine language activities we just completed, a lot will be the same. You’ll need to stick with it, pay attention to detail, and collaborate with others. In fact, before we jump in there’s one new collaboration skill I want to teach you all.
  4. Today we’ll be using a practice called pair programming. Pair progamming helps people make better programs by working together. The main idea is that two programmers use a single computer to collaboratively develop code. There’s a few rules to make sure this system works effectively.
    1. There is only one computer and two programmers.
    2. Assign one student “driver” and the other “navigator”. Don’t worry, you’ll switch often.
    3. The driver is the only one to touch the keyboard/mouse.
    4. The navigator should look for problems in the code and keep track of the high-level plan.
    5. Both driver and navigator should be communicating constantly by talking out loud and sharing ideas.
    6. Driver and navigator roles must switch when the teacher indicates, typically every 3-5 minutes

Activity–Move to App Lab

  1. Get with a partner
  2. To get you situated in App Lab there’s a quick video. Once everyone is through that we’ll get started. I’ll keep track of time and remind you to switch who is driver and navigator every 3 minutes or so. Make sure you’re ready to switch by talking out loud and sharing ideas.
  3. Show me your work in the answer viewer. I will be looking for the following criteria:
    • The program draws the desired figure.
    • The turtle is returned to its starting location and is pointed in the correct direction.
    • The figure is located in the correct position, relative to the starting position of the turtle.
    • The program only makes use of the “building block” commands provided.
    • The program is reasonably efficient in its execution.

Wrap-up–What does “efficiency” mean when programming?

  1. Compare Solutions and Discuss: Each pair of students should get together with another pair to compare their solutions for each of the three problems to determine which is the most efficient. Once they have shared and compared their solutions they can consider the questions below.
  2. In your Word Online file for this class, respond to the following:
    1. What strategies or reasoning did you use to identify possible solutions?
    2. Is the solution that you or another group found the most efficient? How do you know?
    3. What is the “most efficient” way to program the solution for the 3×3 grid?
  3. Share at your tables.
  4. Today’s activity challenged us to find the most efficient solution to a problem. We care about efficiency when we don’t want to waste something valuable, like money, time, or space. We measured the efficiency of our programs in terms of lines of code, but there are other ways to think about efficiency when talking about code or programs that run on a computer. When we try to create efficient programs, what other valuable resources might we be concerned about conserving?

What’s the point? Why constrain to 4 commands

  1. Why did we constrain you to only working with 4 possible commands? We begin programming with only a few commands for a few main reasons:
    1. What you did today is what you always do when programming: use a language to express a solution to a problem. Collaborative problem-solving skills are important factors in programming. Being able to get together with other people to talk about and make reasoned arguments about the best ways to code things is what professionals do.
    2. Learning to program isn’t just a matter of memorizing commands. The art of programming – the creative part – is always about understanding how to use the features of a programming language to solve a problem.
    3. Whether you know 4 commands of a language or hundreds, you will always be constrained by the programming language. The reason you need to learn how to program is because there isn’t a command to do every little thing; you have to understand the set of things that a programming language can do, and then use your creativity and problem-solving skills to get the computer to do what you want.
    4. In this class, we will repeatedly run into the challenges we encountered today. Even seemingly simple problems will require us to creatively apply the tools we have available: the commands or instructions provided by the programming language.
    5. Multiple approaches are always possible to solve a problem. Furthermore, we may never be sure we have found the most efficient one. We may not even agree about how we should measure efficiency.
    6. As we saw today, even when designing programs using four commands to draw with a turtle, the solutions are not always easy. We will definitely need to keep practicing as we start tackling more complex challenges.

Unit 3, Chapter 1, Lesson 5: Creating Functions

Overview

In this lesson, students learn to define and call procedures (in JavaScript, procedures are called “functions”) in order to create and give a name to a group of commands for easy and repeated use in their code. They will be introduced to functions as a form of abstraction that enables them to write code in larger, more logical chunks and focus on what something does, rather than how it does it. As they explore the use of functions through a sequence of activities in App Lab, they will be asked to think about where they see the need for functions and how these functions can make their code clearer or more concise.

At the end of the lesson students review the concept of abstraction and are introduced to elements of the Create PT in preparation for the Practice PT at the end of the unit.

Purpose

Programming languages must necessarily define the meaning of a set of commands which are generally useful and applicable. In order to extend their functionality, nearly all programming languages provide a means for defining and calling new commands which programmers design to fit the needs of the problems they are trying to solve. Defining functions is an example of how computer scientists use abstraction to solve problems. A programmer will design a solution to a small, well-defined portion of the task and then give a name to the associated code. Whenever that problem arises again, the programmer can invoke the new function by name, without having to solve the problem again. This ability to refer to complex functionality by simple, meaningful names allows for programs to be written in more intuitive ways that reflect the relationships between different blocks of code.

Objectives

Students will be able to:

  • Recognize functions in programs as a form of abstraction.
  • Write a program that solves a turtle drawing problem using multiple levels of abstraction (i.e. functions that call other functions within your code).
  • Explain why and how functions can make code easier to read and maintain.
  • Define and call simple functions that solve turtle drawing tasks.

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.
  • Function – A named group of programming instructions. Functions are reusable abstractions that reduce the complexity of writing and maintaining programs.

New Code

Getting Started

  1. In the previous lesson we created simple turtle drawings using only four commands. At some point you probably wished that more commands were available to you. What was one command you wanted to be able to use and explain why you wanted to use it.
  2. Programming languages will always have some commands that are already defined, but there will be many instances when the exact command we want isn’t available. Today we’re going to start exploring a powerful feature of most programming languages that will allow us to overcome this issue and create commands of our own.

Activity–Programming with Functions

  1. Log in to code.org
  2. Work through the lesson on your own–be sure to READ EVERYTHING!!
  3. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. At the end of this unit we will be doing a Practice Create PT that mimics most components of the AP Create PT. We’re going to quickly review those components now, but we’ll have opportunities to review and practice them in the next few lessons as well. For right now you don’t need to understand all the details, just the big picture.
  2. Open this file–read the following sections to give you an overview of your final project for this unit:
    1. Page 9–Performance Task: Create–Applications From Ideas has 3 major components (you will skip the first 2 at this time):
      1. Video
      2. Written Responses
      3. Program Code
    2. Pages 10-11–Skim the submission requirements and actually read all of prompts 2a to 2d–concentrate most on “abstraction” and prompt 2d
  3. Let’s start now making connections between writing functions and “developing abstractions” that helps us when writing to programs. Respond to the following in your Word Online file for this class:
    1. List the benefits of being able to define and call functions in a program. Who specifically gets to enjoy those benefits?
    2. How is the use of a function an example of abstraction?
    3. Which of the following 2 items are true about functions:
      1. Meaningful function names help people better understand programs.
      2. Meaningful function names help computers better understand programs.
      3. Functions in programming are useful mathematical tools for doing complex computations.
      4. Functions in programming are named groupings of programming instructions.
    4. In your own words explain at least one reason why programming languages have functions.

Unit 3, Chapter 1, Lesson 6: Functions and Top-Down Design

Overview

This lesson presents a top-down problem-solving strategy for designing solutions to programming problems. Students use a worksheet to learn about top-down design, and then on paper, design a solution to a new turtle drawing challenge with a partner. Having practiced this approach on paper and in code, students will be re-presented with the 3×3 square challenge from an earlier lesson and asked to improve upon their old solution by designing multiple layers of functions.

Purpose

The main purpose here is to familiarize students with the concept of developing “procedural abstractions.” One of the main learning objectives in the CSP framework is: “2.2.1 Develop an abstraction when writing a program…”. Furthermore the AP Performance Task: Create requires students to “develop an abstraction to manage complexity of your program.” For all intents and purposes, developing abstractions starts with writing reusable functions (or procedures) in your code that encapsulate and give a name to multi-line segments of code that other parts of your code calls upon.

A technique for deciding what functions you should write is to look at the problem with a “top-down design” perspective. The process of creating software begins long before the first lines of code are written. Breaking a problem down into layers of sub-tasks, and writing well-named functions that solve those tasks is a creative act of abstraction. It also leads to good code that is more efficient, easier to read, and therefore easier to debug when problems arise.

In professional settings, teams of people first identify the problems and sub-problems the particular software will be addressing and how it will be used. This approach to designing software is critical when facing large-scale programming tasks. Once the problem is well understood, it can be broken into parts that teams or individual programmers can begin to work on solving at the same time. Full software systems take advantage of the power of abstraction; each programmer in a team can write code, assuming the subproblems will be solved and written by other teammates.

Objectives

Students will be able to:

  • Write a complete program with functions that solve sub-tasks of a larger programming task.
  • Explain how functions are an example of abstraction.
  • Use a “top-down” problem-solving approach to identify sub-tasks of a larger programming task.

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.
  • Function – A named group of programming instructions. Functions are reusable abstractions that reduce the complexity of writing and maintaining programs.
  • Top Down Design – a problem solving approach (also known as stepwise design) in which you break down a system to gain insight into the sub-systems that make it up.

New Code

Getting Started

  1. In the previous lesson we wrote a program that used layers of functions (functions that called other functions) to get the turtle to draw a diamond-shaped figure.
  2. Imagine that you have two programs that drew the diamond-shaped figure. One program uses functions as we did in the previous lesson. The other doesn’t use functions; it’s just a long sequence of the turtle’s primitive commands. Which program is more efficient? Make an argument for why one is more efficient than the other. Share your arguments for one program over the other … “Efficient” can mean several different things here:
    1. It could mean the total number of primitive operations performed by the turtle.
    2. It could mean number of lines of code.
    3. It could hinge on the ability to reuse code within your own code.
    4. It could be about the speed and clarity with which you can write the program.
      1. All of these are valid arguments for a student to make.
  3. Efficiency is an interesting thing to think about, but functions also introduce the ability to leverage the power of abstraction: when we write a function, it solves a small piece of a bigger problem. Having the small problem solved allows us to ignore its details and focus on bigger problems or tasks.
  4. Today we’ll get more practice with thinking about how to break problems down into useful functions.

Activity

  1. Get the Top-Down Design Worksheet & complete it:
    1. Students should work in pairs.
    2. Read the first page of the worksheet that describes the top-down problem solving process.
    3. Design a solution to the problem on the second page by writing down the functions they would write to solve the problem.
    4. After a pair has come up with a solution on paper, have them compare with another group to see similarities and differences.
      1. The point of having students compare top-down designs is mostly just to see that people think about problems differently. Pairs should move to Code Studio after working out a solution on paper.
      2. Evidence of good design
        1. An interesting thing to look at is the name of the top-level function students come up with, which should be a description of what they think they are drawing.
        2. Try to come up with descriptive function names that give insight to their thinking. A high-level function named something like drawThing is not that great. Something like snowflake or crosshairs or antenna is better because it lets the reader see what the programmer is thinking about.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When we layer functions – with functions that call other functions – we are creating layers of abstraction.
  2. In programming, writing functions helps us create layers of abstraction that allow us to design and create increasingly complex systems.
  3. We’ve seen layers of abstraction before in the design of Internet protocols, or in the binary encoding of information.
  4. Solving a fundamental piece of a problem that can be reliably reused in a different context frees us to think about more complex problems because we can trust the piece that has been solved and don’t have to worry about its details.
  5. Solving small problems – like how to send a single bit from one place to another – allows us to think about bigger problems, like sending numbers, or text, or images, to multiple people, over networks, in packets…etc., etc., etc.
  6. Where else in your life have you seen layers of abstraction? Connect the idea of layers of abstraction to some other activity. Include your response in your Word Online file for this class.
  7. There are many possible connections to make since almost any task in life can be broken down ad-infinitum. In the video about functions from the previous lesson, Chris Bosh makes a connection to basketball. Once you know how to dribble and shoot, then you learn some moves to do, and once you know that, you run plays that rely on the fact that those fundamental elements (or the problems) have been solved.
  8. In your Word Online file for this class, respond to the following:
    1. Which of the following statements about writing functions and Top-Down Design is NOT true?
      1. Writing functions helps manage complexity in a program.
      2. Top-Down Design leads to programs which feature multiple layers of abstraction.
      3. Two programmers solving the same problem using Top-Down Design should arrive at identical programs.
      4. Top-Down Design relies upon identifying subproblems of a larger problem.
      5. Top-Down Design assists in identifying the layers of functions that will be used to solve a programming problem.
    2. In the Create Performance Task you will be asked to identify an abstraction in your program and explain how it helps manage the complexity of the program. Functions are a form of abstraction. Pick a function you wrote in your solution to the 3×3 square problem and explain how it helps manage the complexity of your program.

MAKE UP DAY–Get everything in code.org through Lesson 6

All 9-11 graders fill out the FBLA form please.

Unit 3, Chapter 1, Lesson 7: APIs and Using Functions with Parameters

Overview

Students will learn to read App Lab’s API documentation and will use functions that accept parameters in order to complete a series of drawing puzzles which require them to make use of the App Lab API documentation to learn new drawing commands. Many of these commands will require the use of parameters. The final challenge asks students to design a personal monogram making use of the commands they learned during the lesson.

Purpose

An API is a reference guide which catalogs and explains the functionality of a programming language. If a programmer develops the practice of referencing an API, she can make full use of that functionality without undergoing the tedium of memorizing every detail of the language. In today’s lesson, students will need to read through the API in order to find and understand new commands for moving the turtle, selecting colors, and drawing different-sized dots and lines on the screen. Students should not necessarily understand every command in the drawing API in detail, but they should be familiar with referencing the API as a standard part of the process of writing a program. This will also be the first time students are given access to drawing functions that take parameters (e.g., moveForward(40) vs. moveForward()).

Objectives

Students will be able to:

  • Use parameters to provide different values as input to procedures when they are called in a program.
  • Use API documentation to assist in writing programs.
  • Define an API as the set of commands made available by a programming language.

Vocab

  • API – a collection of commands made available to a programmer
  • Documentation – a description of the behavior of a command, function, library, API, etc.
  • Hexadecimal – A base-16 number system that uses sixteen distinct symbols 0-9 and A-F to represent numbers from 0 to 15.
  • Library – a collection of commands / functions, typically with a shared purpose
  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. So far in this unit we have been exploring programming by drawing turtle art with only a few commands. It will probably not surprise you to learn that there are many more commands included in most programming languages, including the version of JavaScript included in App Lab. In fact, most programming languages include hundreds if not thousands of commands.
  2. Do you think programmers memorize all of the commands in a programming language? If not, how is anyone ever able to use an entire programming language?
  3. Programmers weren’t born knowing how a programming language works, and, like you and me, they don’t have perfect memories. Instead they rely on written documentation to help them learn new features of a language and recall how it works. Today we are going to be exploring how useful documentation can be when learning a programming language or just writing software.
    1. FYI: Programming is not some innate talent. Every programmer has to learn by seeing examples of a language being used and reading documentation. In fact, even professional programmers will frequently reference documentation while designing software. Becoming a good programmer is much less about memorizing a language and more about learning habits of mind and patterns that allow you to use a language (including its documentation) effectively!

Activity

  1. At end of the day we hope to be much more talented turtle artists, but we’re also going to be learning another important skill: reading the documentation of a programming language.
  2. Before you ask me or a classmate for help today, I want you to read through the documentation, try the examples, talk with friends, and then talk to me. It may be slower going today, but in the long term it will make you much more confident programmers.
  3. Be sure to read the explanation of the term parameter and not just skip it. It’s an important term to know.
  4. Log in to code.org
  5. Work through the lesson on your own–be sure to READ EVERYTHING!!
  6. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. The level progression for today’s lesson includes many important vocabulary words. While these levels attempt to introduce these words in the context of using them, take a moment at the conclusion of class to review the words covered and ensure students are comfortable using them.
    • Parameter: accepts a value to be passed to a function, typically affecting the behavior of that function (e.g., changing the distance the moveForward() command moves the turtle)
    • Library: a collection of commands / functions, typically with a shared purpose (e.g., a library of functions for manipulating the turtle)
    • API: application program interface, the full set of commands included in a programming language (e.g., every command made available by App Lab)
    • Documentation: a description of the behavior of a function, library, API, etc.
  2. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: What is an API?
      • Abstract Programming Inheritance: The idea that abstractions in languages get “passed down” in newer versions
      • Artificial Parameter Intelligence: The idea that function parameters should be intelligent enough to “know” what you want as a programmer
      • Application Program Interface: A well-documented library of functions provided in a programming language that helps to simplify complex programming tasks.
      • Abstract Parameter Interface: A high-level description of the parameters a function accepts
    2. Multiple Choice: What is a function parameter?
      • “para-meter” — a measure of the distance between a function’s conception and implementation.
      • A way to give input to a function that controls how the function runs.
      • A collection of commands that can be used in a programming language.
      • Another name for the purpose of a function.
      • A named memory location.
    3. Free Response: It is said that functions with parameters generalize the behavior of a more specific command. Explain what this sentence means to you using the difference between turnLeft() and turnLeft(angle).

Unit 3, Chapter 1, Lesson 7: APIs and Using Functions with Parameters

Overview

Students will learn to read App Lab’s API documentation and will use functions that accept parameters in order to complete a series of drawing puzzles which require them to make use of the App Lab API documentation to learn new drawing commands. Many of these commands will require the use of parameters. The final challenge asks students to design a personal monogram making use of the commands they learned during the lesson.

Purpose

An API is a reference guide which catalogs and explains the functionality of a programming language. If a programmer develops the practice of referencing an API, she can make full use of that functionality without undergoing the tedium of memorizing every detail of the language. In today’s lesson, students will need to read through the API in order to find and understand new commands for moving the turtle, selecting colors, and drawing different-sized dots and lines on the screen. Students should not necessarily understand every command in the drawing API in detail, but they should be familiar with referencing the API as a standard part of the process of writing a program. This will also be the first time students are given access to drawing functions that take parameters (e.g., moveForward(40) vs. moveForward()).

Objectives

Students will be able to:

  • Use parameters to provide different values as input to procedures when they are called in a program.
  • Use API documentation to assist in writing programs.
  • Define an API as the set of commands made available by a programming language.

Vocab

  • API – a collection of commands made available to a programmer
  • Documentation – a description of the behavior of a command, function, library, API, etc.
  • Hexadecimal – A base-16 number system that uses sixteen distinct symbols 0-9 and A-F to represent numbers from 0 to 15.
  • Library – a collection of commands / functions, typically with a shared purpose
  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. So far in this unit we have been exploring programming by drawing turtle art with only a few commands. It will probably not surprise you to learn that there are many more commands included in most programming languages, including the version of JavaScript included in App Lab. In fact, most programming languages include hundreds if not thousands of commands.
  2. Do you think programmers memorize all of the commands in a programming language? If not, how is anyone ever able to use an entire programming language?
  3. Programmers weren’t born knowing how a programming language works, and, like you and me, they don’t have perfect memories. Instead they rely on written documentation to help them learn new features of a language and recall how it works. Today we are going to be exploring how useful documentation can be when learning a programming language or just writing software.
    1. FYI: Programming is not some innate talent. Every programmer has to learn by seeing examples of a language being used and reading documentation. In fact, even professional programmers will frequently reference documentation while designing software. Becoming a good programmer is much less about memorizing a language and more about learning habits of mind and patterns that allow you to use a language (including its documentation) effectively!

Activity

  1. At end of the day we hope to be much more talented turtle artists, but we’re also going to be learning another important skill: reading the documentation of a programming language.
  2. Before you ask me or a classmate for help today, I want you to read through the documentation, try the examples, talk with friends, and then talk to me. It may be slower going today, but in the long term it will make you much more confident programmers.
  3. Be sure to read the explanation of the term parameter and not just skip it. It’s an important term to know.
  4. Log in to code.org
  5. Work through the lesson on your own–be sure to READ EVERYTHING!!
  6. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. The level progression for today’s lesson includes many important vocabulary words. While these levels attempt to introduce these words in the context of using them, take a moment at the conclusion of class to review the words covered and ensure students are comfortable using them.
    • Parameter: accepts a value to be passed to a function, typically affecting the behavior of that function (e.g., changing the distance the moveForward() command moves the turtle)
    • Library: a collection of commands / functions, typically with a shared purpose (e.g., a library of functions for manipulating the turtle)
    • API: application program interface, the full set of commands included in a programming language (e.g., every command made available by App Lab)
    • Documentation: a description of the behavior of a function, library, API, etc.
  2. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: What is an API?
      • Abstract Programming Inheritance: The idea that abstractions in languages get “passed down” in newer versions
      • Artificial Parameter Intelligence: The idea that function parameters should be intelligent enough to “know” what you want as a programmer
      • Application Program Interface: A well-documented library of functions provided in a programming language that helps to simplify complex programming tasks.
      • Abstract Parameter Interface: A high-level description of the parameters a function accepts
    2. Multiple Choice: What is a function parameter?
      • “para-meter” — a measure of the distance between a function’s conception and implementation.
      • A way to give input to a function that controls how the function runs.
      • A collection of commands that can be used in a programming language.
      • Another name for the purpose of a function.
      • A named memory location.
    3. Free Response: It is said that functions with parameters generalize the behavior of a more specific command. Explain what this sentence means to you using the difference between turnLeft() and turnLeft(angle).

Unit 3, Chapter 1, Lesson 8: Creating Functions with Parameters

Overview

In this lesson, students practice using and creating functions with parameters. Students learn that writing functions with parameters can generalize solutions to problems even further. Especially in situations where feel like you are about to duplicate some code with only a few changes to some numbers, that is a good time to write a function that accepts parameters. In the second half of the lesson, students make a series of modifications to a program that creates an “Under the Sea” scene by adding parameters to functions to more easily add variation to the scene. Lastly, students are introduced to App Lab’s random number functions to supply random values to function calls so the scene looks a little different every time the program runs.

Purpose

Writing functions with parameters is a simple idea, but it traditionally has some devilish details for new learners of programming. The basic idea is that you often want to write a function that takes some input and performs some action based on that input. For example, the turtle function moveForward is much more useful when you can specify how much to move forward (e.g., moveForward(100)), rather than just a fixed amount every time. It’s very common to encounter situations where as a programmer you realize that you basically need a duplicate of some code you’ve already got, but you just want to change some numbers. That’s a good time to write a function with a parameter; the parameter just acts as a placeholder for some value that you plug in at the time you call the function. Just like it’s considered good practice to give descriptive names to your functions, the same is true for the names of the parameters themselves. For example: drawSquare(sideLength) is better than drawSquare(stuff).

Objectives

Students will be able to:

  • Write functions with parameters to generalize a solution instead of duplicating code.
  • Identify appropriate situations for creating a function with parameters.
  • Use random numbers as inputs to function calls for the purpose of testing.
  • Add parameters to a function in an existing piece of code to generalize its behavior.

Vocab

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. In the previous lesson, we learned to use a lot of new turtle commands. Some of these commands accept a parameter, or even many parameters, which allow us to pass values to the function. This allowed us to make much more interesting images by specifying precisely how far the turtle should move or turn, and introduced the ability to choose specific pen sizes and colors.
  2. Parameters are a powerful programming construct.
    1. Suppose we have a whole group of similar problems, like turning the turtle some amount.
    2. Without a parameter we would need 360 different functions, one for each number of degrees we wanted to turn!
    3. Parameters allow us to use a single function as a general solution to a whole group of problems.
  3. This is clearly a useful construct to use in our programs, and in today’s lesson we’re going to learn how to create functions with parameters for ourselves.

Activity

  1. The levels in Code Studio for this lesson walk students through a number of small exercises that build up to making a small “under the sea” drawing.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When do you need a function with a parameter?
  2. Having used parameters to generalize the behavior of many functions, students should attempt to formalize their understanding of what parameters are and why they are beneficial. Important points:
    1. Parameters allow the creation of a generalized solution to a whole class of problems, rather than individually solving many specific problems.
    2. Parameters remove the need to create repetitive functions, making code easier to write, read, and change.
  3. In your Word Online file for this class, develop a rule for deciding when to create a function with a parameter rather than a normal function. Below your rule write a couple sentences justifying your rule. Share your rules with the class.
  4. Every time you added a parameter to a function, you generalized the behavior of the function without having to rewrite the code.
  5. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: Which of the following are true?
      • Functions with parameters can be used to prevent the creation of duplicated code.
      • Parameters can only be used once within the body of a function.
      • Parameters generalize the solution of a specific problem.
      • Parameters need not be provided to a function in any particular order.
    2. Free Response: “Abstraction” is often used to indicate cases where we focus on a general case and ignore a specific instance of a problem. Given this meaning of the word, how are functions with parameters an example of abstraction?

Unit 3, Chapter 1, Lesson 8: Creating Functions with Parameters

Overview

In this lesson, students practice using and creating functions with parameters. Students learn that writing functions with parameters can generalize solutions to problems even further. Especially in situations where feel like you are about to duplicate some code with only a few changes to some numbers, that is a good time to write a function that accepts parameters. In the second half of the lesson, students make a series of modifications to a program that creates an “Under the Sea” scene by adding parameters to functions to more easily add variation to the scene. Lastly, students are introduced to App Lab’s random number functions to supply random values to function calls so the scene looks a little different every time the program runs.

Purpose

Writing functions with parameters is a simple idea, but it traditionally has some devilish details for new learners of programming. The basic idea is that you often want to write a function that takes some input and performs some action based on that input. For example, the turtle function moveForward is much more useful when you can specify how much to move forward (e.g., moveForward(100)), rather than just a fixed amount every time. It’s very common to encounter situations where as a programmer you realize that you basically need a duplicate of some code you’ve already got, but you just want to change some numbers. That’s a good time to write a function with a parameter; the parameter just acts as a placeholder for some value that you plug in at the time you call the function. Just like it’s considered good practice to give descriptive names to your functions, the same is true for the names of the parameters themselves. For example: drawSquare(sideLength) is better than drawSquare(stuff).

Objectives

Students will be able to:

  • Write functions with parameters to generalize a solution instead of duplicating code.
  • Identify appropriate situations for creating a function with parameters.
  • Use random numbers as inputs to function calls for the purpose of testing.
  • Add parameters to a function in an existing piece of code to generalize its behavior.

Vocab

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. In the previous lesson, we learned to use a lot of new turtle commands. Some of these commands accept a parameter, or even many parameters, which allow us to pass values to the function. This allowed us to make much more interesting images by specifying precisely how far the turtle should move or turn, and introduced the ability to choose specific pen sizes and colors.
  2. Parameters are a powerful programming construct.
    1. Suppose we have a whole group of similar problems, like turning the turtle some amount.
    2. Without a parameter we would need 360 different functions, one for each number of degrees we wanted to turn!
    3. Parameters allow us to use a single function as a general solution to a whole group of problems.
  3. This is clearly a useful construct to use in our programs, and in today’s lesson we’re going to learn how to create functions with parameters for ourselves.

Activity

  1. The levels in Code Studio for this lesson walk students through a number of small exercises that build up to making a small “under the sea” drawing.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When do you need a function with a parameter?
  2. Having used parameters to generalize the behavior of many functions, students should attempt to formalize their understanding of what parameters are and why they are beneficial. Important points:
    1. Parameters allow the creation of a generalized solution to a whole class of problems, rather than individually solving many specific problems.
    2. Parameters remove the need to create repetitive functions, making code easier to write, read, and change.
  3. In your Word Online file for this class, develop a rule for deciding when to create a function with a parameter rather than a normal function. Below your rule write a couple sentences justifying your rule. Share your rules with the class.
  4. Every time you added a parameter to a function, you generalized the behavior of the function without having to rewrite the code.
  5. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: Which of the following are true?
      • Functions with parameters can be used to prevent the creation of duplicated code.
      • Parameters can only be used once within the body of a function.
      • Parameters generalize the solution of a specific problem.
      • Parameters need not be provided to a function in any particular order.
    2. Free Response: “Abstraction” is often used to indicate cases where we focus on a general case and ignore a specific instance of a problem. Given this meaning of the word, how are functions with parameters an example of abstraction?

Unit 3, Chapter 1, Lesson 8: Creating Functions with Parameters

Overview

In this lesson, students practice using and creating functions with parameters. Students learn that writing functions with parameters can generalize solutions to problems even further. Especially in situations where feel like you are about to duplicate some code with only a few changes to some numbers, that is a good time to write a function that accepts parameters. In the second half of the lesson, students make a series of modifications to a program that creates an “Under the Sea” scene by adding parameters to functions to more easily add variation to the scene. Lastly, students are introduced to App Lab’s random number functions to supply random values to function calls so the scene looks a little different every time the program runs.

Purpose

Writing functions with parameters is a simple idea, but it traditionally has some devilish details for new learners of programming. The basic idea is that you often want to write a function that takes some input and performs some action based on that input. For example, the turtle function moveForward is much more useful when you can specify how much to move forward (e.g., moveForward(100)), rather than just a fixed amount every time. It’s very common to encounter situations where as a programmer you realize that you basically need a duplicate of some code you’ve already got, but you just want to change some numbers. That’s a good time to write a function with a parameter; the parameter just acts as a placeholder for some value that you plug in at the time you call the function. Just like it’s considered good practice to give descriptive names to your functions, the same is true for the names of the parameters themselves. For example: drawSquare(sideLength) is better than drawSquare(stuff).

Objectives

Students will be able to:

  • Write functions with parameters to generalize a solution instead of duplicating code.
  • Identify appropriate situations for creating a function with parameters.
  • Use random numbers as inputs to function calls for the purpose of testing.
  • Add parameters to a function in an existing piece of code to generalize its behavior.

Vocab

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. In the previous lesson, we learned to use a lot of new turtle commands. Some of these commands accept a parameter, or even many parameters, which allow us to pass values to the function. This allowed us to make much more interesting images by specifying precisely how far the turtle should move or turn, and introduced the ability to choose specific pen sizes and colors.
  2. Parameters are a powerful programming construct.
    1. Suppose we have a whole group of similar problems, like turning the turtle some amount.
    2. Without a parameter we would need 360 different functions, one for each number of degrees we wanted to turn!
    3. Parameters allow us to use a single function as a general solution to a whole group of problems.
  3. This is clearly a useful construct to use in our programs, and in today’s lesson we’re going to learn how to create functions with parameters for ourselves.

Activity

  1. The levels in Code Studio for this lesson walk students through a number of small exercises that build up to making a small “under the sea” drawing.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When do you need a function with a parameter?
  2. Having used parameters to generalize the behavior of many functions, students should attempt to formalize their understanding of what parameters are and why they are beneficial. Important points:
    1. Parameters allow the creation of a generalized solution to a whole class of problems, rather than individually solving many specific problems.
    2. Parameters remove the need to create repetitive functions, making code easier to write, read, and change.
  3. In your Word Online file for this class, develop a rule for deciding when to create a function with a parameter rather than a normal function. Below your rule write a couple sentences justifying your rule. Share your rules with the class.
  4. Every time you added a parameter to a function, you generalized the behavior of the function without having to rewrite the code.
  5. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: Which of the following are true?
      • Functions with parameters can be used to prevent the creation of duplicated code.
      • Parameters can only be used once within the body of a function.
      • Parameters generalize the solution of a specific problem.
      • Parameters need not be provided to a function in any particular order.
    2. Free Response: “Abstraction” is often used to indicate cases where we focus on a general case and ignore a specific instance of a problem. Given this meaning of the word, how are functions with parameters an example of abstraction?

Unit 3, Chapter 1, Lesson 8: Creating Functions with Parameters

Overview

In this lesson, students practice using and creating functions with parameters. Students learn that writing functions with parameters can generalize solutions to problems even further. Especially in situations where feel like you are about to duplicate some code with only a few changes to some numbers, that is a good time to write a function that accepts parameters. In the second half of the lesson, students make a series of modifications to a program that creates an “Under the Sea” scene by adding parameters to functions to more easily add variation to the scene. Lastly, students are introduced to App Lab’s random number functions to supply random values to function calls so the scene looks a little different every time the program runs.

Purpose

Writing functions with parameters is a simple idea, but it traditionally has some devilish details for new learners of programming. The basic idea is that you often want to write a function that takes some input and performs some action based on that input. For example, the turtle function moveForward is much more useful when you can specify how much to move forward (e.g., moveForward(100)), rather than just a fixed amount every time. It’s very common to encounter situations where as a programmer you realize that you basically need a duplicate of some code you’ve already got, but you just want to change some numbers. That’s a good time to write a function with a parameter; the parameter just acts as a placeholder for some value that you plug in at the time you call the function. Just like it’s considered good practice to give descriptive names to your functions, the same is true for the names of the parameters themselves. For example: drawSquare(sideLength) is better than drawSquare(stuff).

Objectives

Students will be able to:

  • Write functions with parameters to generalize a solution instead of duplicating code.
  • Identify appropriate situations for creating a function with parameters.
  • Use random numbers as inputs to function calls for the purpose of testing.
  • Add parameters to a function in an existing piece of code to generalize its behavior.

Vocab

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. In the previous lesson, we learned to use a lot of new turtle commands. Some of these commands accept a parameter, or even many parameters, which allow us to pass values to the function. This allowed us to make much more interesting images by specifying precisely how far the turtle should move or turn, and introduced the ability to choose specific pen sizes and colors.
  2. Parameters are a powerful programming construct.
    1. Suppose we have a whole group of similar problems, like turning the turtle some amount.
    2. Without a parameter we would need 360 different functions, one for each number of degrees we wanted to turn!
    3. Parameters allow us to use a single function as a general solution to a whole group of problems.
  3. This is clearly a useful construct to use in our programs, and in today’s lesson we’re going to learn how to create functions with parameters for ourselves.

Activity

  1. The levels in Code Studio for this lesson walk students through a number of small exercises that build up to making a small “under the sea” drawing.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When do you need a function with a parameter?
  2. Having used parameters to generalize the behavior of many functions, students should attempt to formalize their understanding of what parameters are and why they are beneficial. Important points:
    1. Parameters allow the creation of a generalized solution to a whole class of problems, rather than individually solving many specific problems.
    2. Parameters remove the need to create repetitive functions, making code easier to write, read, and change.
  3. In your Word Online file for this class, develop a rule for deciding when to create a function with a parameter rather than a normal function. Below your rule write a couple sentences justifying your rule. Share your rules with the class.
  4. Every time you added a parameter to a function, you generalized the behavior of the function without having to rewrite the code.
  5. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: Which of the following are true?
      • Functions with parameters can be used to prevent the creation of duplicated code.
      • Parameters can only be used once within the body of a function.
      • Parameters generalize the solution of a specific problem.
      • Parameters need not be provided to a function in any particular order.
    2. Free Response: “Abstraction” is often used to indicate cases where we focus on a general case and ignore a specific instance of a problem. Given this meaning of the word, how are functions with parameters an example of abstraction?

FINISH:

Unit 3, Chapter 1, Lesson 8: Creating Functions with Parameters

Overview

In this lesson, students practice using and creating functions with parameters. Students learn that writing functions with parameters can generalize solutions to problems even further. Especially in situations where feel like you are about to duplicate some code with only a few changes to some numbers, that is a good time to write a function that accepts parameters. In the second half of the lesson, students make a series of modifications to a program that creates an “Under the Sea” scene by adding parameters to functions to more easily add variation to the scene. Lastly, students are introduced to App Lab’s random number functions to supply random values to function calls so the scene looks a little different every time the program runs.

Purpose

Writing functions with parameters is a simple idea, but it traditionally has some devilish details for new learners of programming. The basic idea is that you often want to write a function that takes some input and performs some action based on that input. For example, the turtle function moveForward is much more useful when you can specify how much to move forward (e.g., moveForward(100)), rather than just a fixed amount every time. It’s very common to encounter situations where as a programmer you realize that you basically need a duplicate of some code you’ve already got, but you just want to change some numbers. That’s a good time to write a function with a parameter; the parameter just acts as a placeholder for some value that you plug in at the time you call the function. Just like it’s considered good practice to give descriptive names to your functions, the same is true for the names of the parameters themselves. For example: drawSquare(sideLength) is better than drawSquare(stuff).

Objectives

Students will be able to:

  • Write functions with parameters to generalize a solution instead of duplicating code.
  • Identify appropriate situations for creating a function with parameters.
  • Use random numbers as inputs to function calls for the purpose of testing.
  • Add parameters to a function in an existing piece of code to generalize its behavior.

Vocab

  • Parameter – An extra piece of information passed to a function to customize it for a specific need

New Code

Getting Started

  1. In the previous lesson, we learned to use a lot of new turtle commands. Some of these commands accept a parameter, or even many parameters, which allow us to pass values to the function. This allowed us to make much more interesting images by specifying precisely how far the turtle should move or turn, and introduced the ability to choose specific pen sizes and colors.
  2. Parameters are a powerful programming construct.
    1. Suppose we have a whole group of similar problems, like turning the turtle some amount.
    2. Without a parameter we would need 360 different functions, one for each number of degrees we wanted to turn!
    3. Parameters allow us to use a single function as a general solution to a whole group of problems.
  3. This is clearly a useful construct to use in our programs, and in today’s lesson we’re going to learn how to create functions with parameters for ourselves.

Activity

  1. The levels in Code Studio for this lesson walk students through a number of small exercises that build up to making a small “under the sea” drawing.
  2. Log in to code.org
  3. Work through the lesson on your own–be sure to READ EVERYTHING!!
  4. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When do you need a function with a parameter?
  2. Having used parameters to generalize the behavior of many functions, students should attempt to formalize their understanding of what parameters are and why they are beneficial. Important points:
    1. Parameters allow the creation of a generalized solution to a whole class of problems, rather than individually solving many specific problems.
    2. Parameters remove the need to create repetitive functions, making code easier to write, read, and change.
  3. In your Word Online file for this class, develop a rule for deciding when to create a function with a parameter rather than a normal function. Below your rule write a couple sentences justifying your rule. Share your rules with the class.
  4. Every time you added a parameter to a function, you generalized the behavior of the function without having to rewrite the code.
  5. In your Word Online file for this class, respond to the following:
    1. Multiple Choice: Which of the following are true?
      • Functions with parameters can be used to prevent the creation of duplicated code.
      • Parameters can only be used once within the body of a function.
      • Parameters generalize the solution of a specific problem.
      • Parameters need not be provided to a function in any particular order.
    2. Free Response: “Abstraction” is often used to indicate cases where we focus on a general case and ignore a specific instance of a problem. Given this meaning of the word, how are functions with parameters an example of abstraction?

Unit 3, Chapter 1, Lesson 9: Looping and Random Numbers

Overview

Students learn to use random values and looping to create variation in their drawings and quickly duplicate objects they wish to appear in their digital scenes many times. Students will be presented with a version of the for loop which only enables them to change the number of times the loop runs. This block is essentially a “repeat” block and will be presented that way. Students will also be presented with blocks which enable them to choose a random number within a given range. Together these blocks enable students to create more complex backgrounds for digital scenes by randomly placing simple objects within the background of their scene. Students use these tools to step through the Under the Sea exemplar digital scene.

Purpose

Loops are a relatively straightforward idea in programming – you want a certain chunk of code to run repeatedly – but it takes a little practice to get good at controlling loops and recognizing how and where in your programs to use them. The for loop in JavaScript (and many other programming languages) is designed to be used for both simple and sophisticated programming tasks, thus it has a lot of syntax to it that will be explained in the future. In this lesson, the block-based form of the for loop exposed to students is effectively a simple repeat loop – it only lets them change a number that dictates how many times the loop repeats.

Random numbers are also used more (much more) in this lesson as an effective way to experiment with loops. Creating some randomly-generated output with each iteration of the loop is good visual feedback that the loop is running the way you expect. It also helps you explore the ranges of possible outputs, which tells you more about what your program can and cannot do.

Objectives

Students will be able to:

  • Use a loop in a program to simplify the expression of repeated tasks.
  • Identify appropriate situations in a program for using a loop.
  • Use random values within a loop to repeat code that behaves differently each time it is executed.

Vocab

  • For Loop – Loops that have a predetermined beginning, end, and increment (step interval).
  • Loop – The action of doing something over and over again.

New Code

Getting Started

  1. Loops versus Functions–As we have developed as programmers, we have focused on the process of breaking down large tasks into smaller pieces and assigning each piece a function.
  2. When we break down a large task, often we will find that some portion of the task needs to be repeated many times. As programmers, we would simply call the same function many times. This might work if we need to call the same function five times, but if that function needs to be run 1,000,000 times, we’ll need a better solution.
  3. Today we’ll be exploring how a programming construct called a loop solves this problem by allowing us to repeat a set of commands many times.
  4. We’ll also practice looping through commands many times with random input, therefore giving us many instances of random output.
  5. Just as we saw yesterday, this will be both useful for testing our code and also for developing more variety in our drawings.
  6. At the end of class we’ll ask: “When should you use a loop instead of a function, or vice versa?”

Activity

  1. Today we’ll learn how to use something called a “for loop”
  2. The for loop is a JavaScript programming construct – it looks and works the same here as it does in “the real world”.
  3. Log in to code.org
  4. Work through the lesson on your own–be sure to READ EVERYTHING!!
  5. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When to use loops versus functions–Having used loops to repeatedly run a smaller portion of a larger program, students should attempt to formalize their understanding of when a loop should be used.
  2. In your Word Online file for this class, respond to:  Develop a rule for deciding when to use a loop within a program. Perhaps think about when to use a loop versus a function. Try to make connections to Top-Down Design in your response. Below your rule, write a couple sentences justifying your rule.
  3. Important points to draw out are related to when to use a function v. when to use a loop. While you can get code to function similarly with a function or a loop the general rule of thumb is:
    • Write a function when you have a piece of code – a procedure – that you might reuse in other places in your program.
      • A function might also help you encapsulate a solution to a common problem in one place that you can call on repeatedly with different inputs (e.g. drawSquare(size))
      • Writing a function is often more of a design decision. You are trying to encapsulate and abstract details so you think about other parts of a larger program
    • Write a loop when there is something you need to do over and over again and it doesn’t make sense to split it up any more.
      • Writing a loop is more of an algorithmic decision – you actually just need repetitious behavior to solve some problem.
      • For example, we don’t want to manually call functions many times in a row. If you’re calling the same function many times in a row, it’s time to make a loop.
  4. In your Word Online file for this class, respond to the following:
    1. When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it’s appropriate to write a new function; at other times it’s appropriate to write a loop. There is no hard-and-fast rule as to which is better, but what do you think? What kinds of circumstances would lead you to writing a function versus using a loop?

Unit 3, Chapter 1, Lesson 9: Looping and Random Numbers

Overview

Students learn to use random values and looping to create variation in their drawings and quickly duplicate objects they wish to appear in their digital scenes many times. Students will be presented with a version of the for loop which only enables them to change the number of times the loop runs. This block is essentially a “repeat” block and will be presented that way. Students will also be presented with blocks which enable them to choose a random number within a given range. Together these blocks enable students to create more complex backgrounds for digital scenes by randomly placing simple objects within the background of their scene. Students use these tools to step through the Under the Sea exemplar digital scene.

Purpose

Loops are a relatively straightforward idea in programming – you want a certain chunk of code to run repeatedly – but it takes a little practice to get good at controlling loops and recognizing how and where in your programs to use them. The for loop in JavaScript (and many other programming languages) is designed to be used for both simple and sophisticated programming tasks, thus it has a lot of syntax to it that will be explained in the future. In this lesson, the block-based form of the for loop exposed to students is effectively a simple repeat loop – it only lets them change a number that dictates how many times the loop repeats.

Random numbers are also used more (much more) in this lesson as an effective way to experiment with loops. Creating some randomly-generated output with each iteration of the loop is good visual feedback that the loop is running the way you expect. It also helps you explore the ranges of possible outputs, which tells you more about what your program can and cannot do.

Objectives

Students will be able to:

  • Use a loop in a program to simplify the expression of repeated tasks.
  • Identify appropriate situations in a program for using a loop.
  • Use random values within a loop to repeat code that behaves differently each time it is executed.

Vocab

  • For Loop – Loops that have a predetermined beginning, end, and increment (step interval).
  • Loop – The action of doing something over and over again.

New Code

Getting Started

  1. Loops versus Functions–As we have developed as programmers, we have focused on the process of breaking down large tasks into smaller pieces and assigning each piece a function.
  2. When we break down a large task, often we will find that some portion of the task needs to be repeated many times. As programmers, we would simply call the same function many times. This might work if we need to call the same function five times, but if that function needs to be run 1,000,000 times, we’ll need a better solution.
  3. Today we’ll be exploring how a programming construct called a loop solves this problem by allowing us to repeat a set of commands many times.
  4. We’ll also practice looping through commands many times with random input, therefore giving us many instances of random output.
  5. Just as we saw yesterday, this will be both useful for testing our code and also for developing more variety in our drawings.
  6. At the end of class we’ll ask: “When should you use a loop instead of a function, or vice versa?”

Activity

  1. Today we’ll learn how to use something called a “for loop”
  2. The for loop is a JavaScript programming construct – it looks and works the same here as it does in “the real world”.
  3. Log in to code.org
  4. Work through the lesson on your own–be sure to READ EVERYTHING!!
  5. Evaluate at least 1 program someone else did. Include the name of the person whose code you critiqued. Use the following criteria:
    1. The program draws the diamond
    2. The program defines four functions: right(); drawStep(); drawSide(); and drawDiamond(); The names are less important than the existence of four functions with this functionality.
    3. The program makes a single call to drawDiamond();
    4. The program looks clean and organized

Wrap-up

  1. When to use loops versus functions–Having used loops to repeatedly run a smaller portion of a larger program, students should attempt to formalize their understanding of when a loop should be used.
  2. In your Word Online file for this class, respond to:  Develop a rule for deciding when to use a loop within a program. Perhaps think about when to use a loop versus a function. Try to make connections to Top-Down Design in your response. Below your rule, write a couple sentences justifying your rule.
  3. Important points to draw out are related to when to use a function v. when to use a loop. While you can get code to function similarly with a function or a loop the general rule of thumb is:
    • Write a function when you have a piece of code – a procedure – that you might reuse in other places in your program.
      • A function might also help you encapsulate a solution to a common problem in one place that you can call on repeatedly with different inputs (e.g. drawSquare(size))
      • Writing a function is often more of a design decision. You are trying to encapsulate and abstract details so you think about other parts of a larger program
    • Write a loop when there is something you need to do over and over again and it doesn’t make sense to split it up any more.
      • Writing a loop is more of an algorithmic decision – you actually just need repetitious behavior to solve some problem.
      • For example, we don’t want to manually call functions many times in a row. If you’re calling the same function many times in a row, it’s time to make a loop.
  4. In your Word Online file for this class, respond to the following:
    1. When breaking a problem down, you often encounter elements that you want to use repeatedly in your code. Sometimes it’s appropriate to write a new function; at other times it’s appropriate to write a loop. There is no hard-and-fast rule as to which is better, but what do you think? What kinds of circumstances would lead you to writing a function versus using a loop?

Unit 3, Chapter 1, Lesson 10: Practice PT – Design a Digital

Scene

Overview

To conclude their introduction to programming, students will design a program that draws a digital scene of their choosing. Students will be working in groups of 3 or 4 and will begin by identifying a scene they wish to create. They will then use Top-Down Design to identify the high-level functions necessary to create that image. The group will then assign these components to individual members of the group to program. After programming their individual portion, students will combine all of their code to compose the whole scene. The project concludes with reflection questions similar to those students will see on the AP® Performance Tasks.

Note: This is NOT the official AP Performance Task that will be submitted as part of the Advanced Placement exam; it is a practice activity intended to prepare students for some portions of their individual performance at a later time.

AP® is a trademark registered and/or owned by the College Board, which was not involved in the production of, and does not endorse, this curriculum.

Purpose

Abstraction is an important tool in programming, not only because it allows individual programmers to break down complex problems, but because it enables effective forms of collaboration. Once a problem has been broken down into its component parts, teams of programmers (sometimes dozens or more) can attack individual components of that problem in parallel. This style of programming requires clear communication and a shared understanding of the high-level requirements of the software. If implemented carefully, however, it can be an effective strategy for rapidly producing large and complex pieces of software.

Objectives

Students will be able to:

  • Write programs that address one component of a larger programming problem and integrate with other similarly designed programs.
  • Collaborate to break down a complex programming problem into its component parts.
  • Use code written by other programmers to complete a larger programming task.
  • Write responses to AP-style prompts

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.

New Code

Getting Started

  1. Review the programming constructs covered thus far, recall how they can be used within Top-Down Design to break down problems, and frame the coming project as a further exploration of the concept of abstraction.
  2. Get a copy of the following (digital copies available on code studio):
    1. Design a Digital Scene – Project Guide 2019 – Project
    2. GuideDesign a Digital Scene – AP Rubric 2019 – AP Rubric
    3. Design a Digital Scene – Project and Programming Rubric
  3. Read Requirements
  4. Emphasize and call out connections to the AP Create PT: Students will be going through many of the same processes for this project as they will for the AP Create PT. The things we are not doing here are:
    1. student is not coming up with the idea for the project – we are framing it as Design a Digital Scene
    2. we are not making a video of code running
    3. we are ignoring the writing prompts about algorithms
    4. We’ll address these things later in Unit 5.
  5. Place Students in Groups: Groups will ideally be 3 or 4 students for this project.
  6. A proposed schedule of the steps of this project is included below.

    Day 1

    • Review the project guidelines and the rubric.
    • Assign students to groups to follow the Group Project Planning guide.
    • Groups complete the Project Description document.
    • Groups break target scene into high-level functions, define their behavior and complete the Project Component Table.
    • Students begin programming individual components.

    Day 2

    • Students continue to work on programming their individual functions.
    • Groups begin to recombine their functions and students begin work on their digital scenes.

    Day 3

    • Students finalize their digital scenes.
    • Students complete their reflection questions and submit their projects.

Wrap-up

  1. Reflection Questions: Students can complete the reflection questions using the Practice PT – Written Responses – Student AP Response Templateor simply write them into a plain text document.
  2. Program Code: Students should simply submit their project code through Code Studio by clicking the Submit button where they composed their project.
  3. Project Submission:1. Student written responses – do this in your Word Online file for this class. I will use the Design a Digital Scene – AP Rubric 2019 – AP Rubric to score it.2. Student code – You should always submit the project through Code Studio so it gets locked in. In addition, submit a PDF of your code with the abstraction you developed highlighted with a rectangle drawn around it. Use CodePrint to do this. Send it to me as an email attachment. I will use the Design a Digital Scene – Project and Programming Rubric to assess your coding skills.3. Group planning guide – Credit for completion

Unit 3, Chapter 1, Lesson 10: Practice PT – Design a Digital

Scene

Overview

To conclude their introduction to programming, students will design a program that draws a digital scene of their choosing. Students will be working in groups of 3 or 4 and will begin by identifying a scene they wish to create. They will then use Top-Down Design to identify the high-level functions necessary to create that image. The group will then assign these components to individual members of the group to program. After programming their individual portion, students will combine all of their code to compose the whole scene. The project concludes with reflection questions similar to those students will see on the AP® Performance Tasks.

Note: This is NOT the official AP Performance Task that will be submitted as part of the Advanced Placement exam; it is a practice activity intended to prepare students for some portions of their individual performance at a later time.

AP® is a trademark registered and/or owned by the College Board, which was not involved in the production of, and does not endorse, this curriculum.

Purpose

Abstraction is an important tool in programming, not only because it allows individual programmers to break down complex problems, but because it enables effective forms of collaboration. Once a problem has been broken down into its component parts, teams of programmers (sometimes dozens or more) can attack individual components of that problem in parallel. This style of programming requires clear communication and a shared understanding of the high-level requirements of the software. If implemented carefully, however, it can be an effective strategy for rapidly producing large and complex pieces of software.

Objectives

Students will be able to:

  • Write programs that address one component of a larger programming problem and integrate with other similarly designed programs.
  • Collaborate to break down a complex programming problem into its component parts.
  • Use code written by other programmers to complete a larger programming task.
  • Write responses to AP-style prompts

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.

New Code

Getting Started

  1. Review the programming constructs covered thus far, recall how they can be used within Top-Down Design to break down problems, and frame the coming project as a further exploration of the concept of abstraction.
  2. Get a copy of the following (digital copies available on code studio):
    1. Design a Digital Scene – Project Guide 2019 – Project
    2. GuideDesign a Digital Scene – AP Rubric 2019 – AP Rubric
    3. Design a Digital Scene – Project and Programming Rubric
  3. Read Requirements
  4. Emphasize and call out connections to the AP Create PT: Students will be going through many of the same processes for this project as they will for the AP Create PT. The things we are not doing here are:
    1. student is not coming up with the idea for the project – we are framing it as Design a Digital Scene
    2. we are not making a video of code running
    3. we are ignoring the writing prompts about algorithms
    4. We’ll address these things later in Unit 5.
  5. Place Students in Groups: Groups will ideally be 3 or 4 students for this project.
  6. A proposed schedule of the steps of this project is included below.

    Day 1

    • Review the project guidelines and the rubric.
    • Assign students to groups to follow the Group Project Planning guide.
    • Groups complete the Project Description document.
    • Groups break target scene into high-level functions, define their behavior and complete the Project Component Table.
    • Students begin programming individual components.

    Day 2

    • Students continue to work on programming their individual functions.
    • Groups begin to recombine their functions and students begin work on their digital scenes.

    Day 3

    • Students finalize their digital scenes.
    • Students complete their reflection questions and submit their projects.

Wrap-up

  1. Reflection Questions: Students can complete the reflection questions using the Practice PT – Written Responses – Student AP Response Templateor simply write them into a plain text document.
  2. Program Code: Students should simply submit their project code through Code Studio by clicking the Submit button where they composed their project.
  3. Project Submission:1. Student written responses – do this in your Word Online file for this class. I will use the Design a Digital Scene – AP Rubric 2019 – AP Rubric to score it.2. Student code – You should always submit the project through Code Studio so it gets locked in. In addition, submit a PDF of your code with the abstraction you developed highlighted with a rectangle drawn around it. Use CodePrint to do this. Send it to me as an email attachment. I will use the Design a Digital Scene – Project and Programming Rubric to assess your coding skills.3. Group planning guide – Credit for completion

Unit 3, Chapter 1, Lesson 10: Practice PT – Design a Digital

Scene

Overview

To conclude their introduction to programming, students will design a program that draws a digital scene of their choosing. Students will be working in groups of 3 or 4 and will begin by identifying a scene they wish to create. They will then use Top-Down Design to identify the high-level functions necessary to create that image. The group will then assign these components to individual members of the group to program. After programming their individual portion, students will combine all of their code to compose the whole scene. The project concludes with reflection questions similar to those students will see on the AP® Performance Tasks.

Note: This is NOT the official AP Performance Task that will be submitted as part of the Advanced Placement exam; it is a practice activity intended to prepare students for some portions of their individual performance at a later time.

AP® is a trademark registered and/or owned by the College Board, which was not involved in the production of, and does not endorse, this curriculum.

Purpose

Abstraction is an important tool in programming, not only because it allows individual programmers to break down complex problems, but because it enables effective forms of collaboration. Once a problem has been broken down into its component parts, teams of programmers (sometimes dozens or more) can attack individual components of that problem in parallel. This style of programming requires clear communication and a shared understanding of the high-level requirements of the software. If implemented carefully, however, it can be an effective strategy for rapidly producing large and complex pieces of software.

Objectives

Students will be able to:

  • Write programs that address one component of a larger programming problem and integrate with other similarly designed programs.
  • Collaborate to break down a complex programming problem into its component parts.
  • Use code written by other programmers to complete a larger programming task.
  • Write responses to AP-style prompts

Vocab

  • Abstraction – a simplified representation of something more complex. Abstractions allow you to hide details to help you manage complexity, focus on relevant concepts, and reason about problems at a higher level.

New Code

Getting Started

  1. Review the programming constructs covered thus far, recall how they can be used within Top-Down Design to break down problems, and frame the coming project as a further exploration of the concept of abstraction.
  2. Get a copy of the following (digital copies available on code studio):
    1. Design a Digital Scene – Project Guide 2019 – Project
    2. GuideDesign a Digital Scene – AP Rubric 2019 – AP Rubric
    3. Design a Digital Scene – Project and Programming Rubric
  3. Read Requirements
  4. Emphasize and call out connections to the AP Create PT: Students will be going through many of the same processes for this project as they will for the AP Create PT. The things we are not doing here are:
    1. student is not coming up with the idea for the project – we are framing it as Design a Digital Scene
    2. we are not making a video of code running
    3. we are ignoring the writing prompts about algorithms
    4. We’ll address these things later in Unit 5.
  5. Place Students in Groups: Groups will ideally be 3 or 4 students for this project.
  6. A proposed schedule of the steps of this project is included below.

    Day 1

    • Review the project guidelines and the rubric.
    • Assign students to groups to follow the Group Project Planning guide.
    • Groups complete the Project Description document.
    • Groups break target scene into high-level functions, define their behavior and complete the Project Component Table.
    • Students begin programming individual components.

    Day 2

    • Students continue to work on programming their individual functions.
    • Groups begin to recombine their functions and students begin work on their digital scenes.

    Day 3

    • Students finalize their digital scenes.
    • Students complete their reflection questions and submit their projects.

Wrap-up

  1. Reflection Questions: Students can complete the reflection questions using the Practice PT – Written Responses – Student AP Response Templateor simply write them into a plain text document.
  2. Program Code: Students should simply submit their project code through Code Studio by clicking the Submit button where they composed their project.
  3. Project Submission:1. Student written responses – do this in your Word Online file for this class. I will use the Design a Digital Scene – AP Rubric 2019 – AP Rubric to score it.2. Student code – You should always submit the project through Code Studio so it gets locked in. In addition, submit a PDF of your code with the abstraction you developed highlighted with a rectangle drawn around it. Use CodePrint to do this. Send it to me as an email attachment. I will use the Design a Digital Scene – Project and Programming Rubric to assess your coding skills.3. Group planning guide – Credit for completion

 

Which one should we focus on for the remainder of the semester? Should we all focus on one or should everyone get a chance to focus on the one of their choosing?
http://www.muvizu.com/
http://appinventor.mit.edu/explore/
https://www.daz3d.com/help/help-daz-3d-video-tutorials
http://wimi5.com/help-tutorials/

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The background–FINISH TODAY
    2. The ship
    3. Shooting
    4. The asteroids
    5. Collisions
    6. Collisions between shots and asteroids
    7. Collisions between the asteroids and the ship
    8. Collisions between the ship and the edge of the scene
    9. Scoreboard
    10. Game over
    11. And now what?

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–BEGIN TODAY
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–START HERE: Here we’re going to read the keypresses that we’re interested in. In this case, the up cursor, the down cursor, and the spacebar for the shots. There is a box called KeyListener in the Devices category whose function is just that. Drag out three KeyListener to the logic.
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–START HERE:
      1. Click on the box to see its properties and select setTranslationSpeed in the actionproperty. You’ll see that the parameters change to:
        1. translatePerSecond: indicates the speed in pixels/second we want to move the object at.
        2. seconds: the number of seconds we want to move the object, or leave it empty for indefinite movement.
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–START HERE:
      1. Click on the box to see its properties and select setTranslationSpeed in the actionproperty. You’ll see that the parameters change to:
        1. translatePerSecond: indicates the speed in pixels/second we want to move the object at.
        2. seconds: the number of seconds we want to move the object, or leave it empty for indefinite movement.
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–START HERE:
      1. Click on the box to see its properties and select setTranslationSpeed in the actionproperty. You’ll see that the parameters change to:
        1. translatePerSecond: indicates the speed in pixels/second we want to move the object at.
        2. seconds: the number of seconds we want to move the object, or leave it empty for indefinite movement.
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?
  1. Log in to your wimi5.com account
  2. Click the Help menu
  3. Choose Tutorial
  4. Go to http://wimi5.com/learn/customize-templates/
  5. Customize it to make it your own game.

PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–START HERE:
      1. Click on the box to see its properties and select setTranslationSpeed in the actionproperty. You’ll see that the parameters change to:
        1. translatePerSecond: indicates the speed in pixels/second we want to move the object at.
        2. seconds: the number of seconds we want to move the object, or leave it empty for indefinite movement.
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?
CONTINUE TO CUSTOMIZE YOUR PROJECT. WE WILL ALL PLAY EACH OTHER’S GAMES ON THURSDAY.
PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. The ship–START HERE:
      1. Click on the box to see its properties and select setTranslationSpeed in the actionproperty. You’ll see that the parameters change to:
        1. translatePerSecond: indicates the speed in pixels/second we want to move the object at.
        2. seconds: the number of seconds we want to move the object, or leave it empty for indefinite movement.
    2. Shooting
    3. The asteroids
    4. Collisions
    5. Collisions between shots and asteroids
    6. Collisions between the asteroids and the ship
    7. Collisions between the ship and the edge of the scene
    8. Scoreboard
    9. Game over
    10. And now what?
CONTINUE TO CUSTOMIZE YOUR PROJECT. WE WILL ALL PLAY EACH OTHER’S GAMES ON THURSDAY.
PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. Collisions between the ship and the edge of the scene–FINISH TODAY
    2. Scoreboard
    3. Game over
    4. And now what?
CONTINUE TO CUSTOMIZE YOUR PROJECT. WE WILL ALL PLAY EACH OTHER’S GAMES NEXT CLASS.
PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. Scoreboard–FINISH TODAY
    2. Game over
    3. And now what?
PLAY EACH OTHER’S GAMES
EVALUATE THE COURSE
PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. Game over–FINISH TODAY
    2. And now what?
PICK UP WHERE YOU LEFT OFF IN THE TUTORIAL YESTERDAY:

  1. GO TO wimi5.com and log in–click the squiggly line to edit your game–be sure you are on the LOGIC tab
  2. GO HERE
  3. SCROLL DOWN TO: As you can see in the following image, the logic desktop is initially made up of the Logic chartLogic treeAsset Manager, and Preview panels.
  4. CONTINUE………..
    1. And now what?–FINISH TODAY

GOAL: Before you leave today you will begin to learn

Alice………..

  1. What is Alice?–Let’s read and watch the videos together. BOOKMARK THIS WEBSITE!!
  2. Download Alice 3.2
  3. Do the Alice tutorial:
    1. Launch Alice–get it on half of your screen
    2. GET THESE VIDEO TUTORIALS ON THE OTHER 1/2 OF YOUR SCREEN
      1. SCENE EDITOR OVERVIEW
      2. ADDING OBJECTS
      3. POSITIONING OBJECTS
      4. ROTATING OBJECTS
      5. RESIZING OBJECTS
      6. MANIPULATING OBJECT JOINTS

GOAL: Before you leave today you will know how to:

  1. Create and save a new project
  2. Add an object to a scene
  3. Save a new version of a project
  4. Code a programming instruction
  5. Copy, edit, and undo programming instructions
  6. Test and debug the animation

RIGHT NOW:

  1. Let’s take a look at this together: 
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [826.64 KB]

  2. READ the slides–not very interesting, but very helpful!! 
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [2.64 MB]

    Under: Alice 3 White Rabbit Project File by Oracle Academy, click DOWNLOAD and choose to save it to your Google Drive

GOAL: Before you leave today you will know how to:

  1. Create and save a new project
  2. Add an object to a scene
  3. Save a new version of a project
  4. Code a programming instruction
  5. Copy, edit, and undo programming instructions
  6. Test and debug the animation

RIGHT NOW:

  1. Refer to this if needed. We went through this together last class:  
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [2.64 MB]

  2. TRY IT: 
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [25.37 KB]

    1. When you are done with #6–SHOW A NEIGHBOR–Make sure you both are correct–Help each other get it right. This is what it should look like:
      1. Finished White Rabbit Lesson 1
    2. Do the Optional Activities & SHOW YOUR NEIGHBOR when you are done with each one–Help each other get it right.
  3. Writing for today: What did you learn? How can this be useful? Who did you help? How did it go?

GOAL: Before you leave today you will know how to:

  1. Open a saved version of a project
  2. Add multiple objects to a scene
  3. Describe the difference between precise positioning and drag-and-drop (or imprecise) positioning drop (or imprecise) positioning
  4. Use a one-shot procedure to precisely position an object in a scene

RIGHT NOW:

  1. Read this:  
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [1.23 MB]

  2. TRY IT: 
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [25.45 KB]

    1. When you are done with #6–SHOW A NEIGHBOR–Make sure you both are correct–Help each other get it right. This is what it should look like:
      1. Finished White Rabbit Lesson 2
    2. You can use this file from lesson 1 if you didn’t finish it last class or if you may have not done it correctly: Finished White Rabbit Lesson 1
    3. Do the Optional Activities & SHOW YOUR NEIGHBOR when you are done with each one–Help each other get it right.
  3. Writing for today: What did you learn? How can this be useful? Who did you help? How did it go?
GOAL: Before you leave today you will know how to:

  1. Toggle between, and describe the visual differences between, the Scene editor and the Code editor
  2. Locate and describe the purpose of the methods panel and the procedures tab
  3. Use procedures to move objects
  4. Add Java programming procedures to the Code editor
  5. Demonstrate how procedure values can be altered
  6. Create programming comments
  7. Reorder, edit, delete, copy, and disable programming statements
  8. Test and debug an animation

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment:
    Loader Loading...
    EAD Logo Taking too long?

    Reload Reload document
    | Open Open in new tab

    Download [1.42 MB]

  2. DO: Lesson3_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 2
    2. Show me when you are done with #6–Here is what it should look like: Finished White Rabbit Lesson 3
    3. Show me BOTH of the optional activities as you finish them.
  3. Send me a note stating what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Correlate storyboard statements with program execution tasks
  2. Add a control statement to the Code editor
  3. Use random numbers to randomize motion

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-4_NEW
  2. DO: Lesson4_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 3
    2. Show me when you are done with #4–Here is what it should look like when you are done: Finished White Rabbit Lesson 4
    3. Show me ALL 3 of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
FINISH
GOAL: Before you leave today you will know how to:

  1. Correlate storyboard statements with program execution tasks
  2. Add a control statement to the Code editor
  3. Use random numbers to randomize motion

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-4_NEW
  2. DO: Lesson4_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 3
    2. Show me when you are done with #4–Here is what it should look like when you are done: Finished White Rabbit Lesson 4
    3. Show me ALL 3 of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Compare and define an animation and a scenario
  2. Write a storyboard
  3. Flowchart a storyboard
  4. Describe inheritance and how traits are passed from superclasses to subclasses
  5. Describe when to implement procedural abstraction
  6. Demonstrate how to declare a procedure
  7. Identify and use procedural abstraction techniques to simplify animation development

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-5_NEW
  2. DO: Lesson5_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 4
    2. Show me when you are done with #7–Here is what it should look like: Finished White Rabbit Lesson 5
    3. Show me ALL 4 of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Compare and define an animation and a scenario
  2. Write a storyboard
  3. Flowchart a storyboard
  4. Describe inheritance and how traits are passed from superclasses to subclasses
  5. Describe when to implement procedural abstraction
  6. Demonstrate how to declare a procedure
  7. Identify and use procedural abstraction techniques to simplify animation development

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-5_NEW
  2. DO: Lesson5_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 4
    2. Show me when you are done with #7–Here is what it should look like: Finished White Rabbit Lesson 5
    3. Show me ALL 4 of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Define multiple control statements to control animation timing
  2. Create an animation that uses a control statement to control animation timing
  3. Recognize programming constructs to invoke simultaneous movement

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-6_NEW
  2. DO: Lesson6_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 5
    2. Show me when you are done with #4–Here is what it will look like when it is done: Finished White Rabbit Lesson 6
    3. Show me BOTH of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
FINISH:
GOAL: Before you leave today you will know how to:

  1. Define multiple control statements to control animation timing
  2. Create an animation that uses a control statement to control animation timing
  3. Recognize programming constructs to invoke simultaneous movement

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-6_NEW
  2. DO: Lesson6_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 5
    2. Show me when you are done with #4–Here is what it will look like when it is done: Finished White Rabbit Lesson 6
    3. Show me BOTH of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Correlate storyboard statements with program execution tasks
  2. Add a control statement to the Code editor
  3. Use random numbers to randomize motion

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-4_NEW
  2. DO: Lesson4_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 3
    2. Show me when you are done with #4–Here is what it should look like when you are done: Finished White Rabbit Lesson 4
    3. Show me ALL 3 of the optional activities as you finish them.
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.

PROBLEM: There are social issues and crises going on in the world today. You need to bring to light one of these situations that you find interesting and share it with the world through a blog post.

  1. BLOG DAY–Blog about a topic of your choice–share it with me.
    1. Go to Google
    2. Click More
    3. Choose Blogger
    4. CREATE A NEW POST: Blog about a topic of your choice. Take a stand and then back up your claim with 3-4 reasons for your stance on your topic. EDUCATE YOUR AUDIENCE ON A TOPIC OF YOUR CHOICE!! Use the Internet. Provide web links, YouTube clips, and pictures to support your claim.
    5. SHARE the blog post with me and your classmates by posting it on your class’ Edmodo page.
      1. Change the Layout of your blog:
        1. Click the Down arrow on the button (Go to post list) beside the pencil on the page that lists your blogs.
  2. Choose Layout
  3. EXPERIMENT!! Customize your blog!!
  4. PLEASE SIGN UP FOR ADVANCED COMPUTER APPLICATIONS NE2XT YEAR. IT IS FOR COLLEGE CREDIT!!! Also, consider taking the following classes:
    1. Multimedia Marketing–Photoshop & Moviemaker are used to create advertisments, commercials, and promotional materials.
    2. 21st Century Business I–Entrepreneurship–Learn how to start your own business.
    3. 21st Century Business II–Personal Finance–Learn about financial skills you will need for the rest of your life.
  5. WHAT MOST SCHOOLS DON”T TEACH–Watch this video clip–We do this at Bellevue High School!! Multimedia Marketing & Intro to Web Design (it is also college credit!!)
READ THIS FOR INSPIRATION
BEGIN:
GOAL: Before you leave today you will know how to:

  1. Use functions to control movement based on a return value

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-7_NEW
  2. DO: Lesson7_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 6
    2. Show me when you are done with #4–When you are done it should look like this: Finished White Rabbit Lesson 7
    3. Show me BOTH of the optional activities as you finish them. MAKE IT COOL!!
  3. In the Google Doc for this class tell me what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Use the IF control structure to effect execution of instructions
  2. Use the WHILE control structure to create a conditional loop for repetitive behavior

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-8_NEW
  2. DO: Lesson8_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 7
    2. Show me when you are done with #4–Here is what it should look like when you are done: Finished White Rabbit Lesson 8
    3. Show me ALL 3 of the optional activities as you finish them.
  3. Send me a note stating what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:
  1. Create an expression to perform a math operation
  2. Interpret a math expression

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-9_NEW
  2. DO: Lesson9_TryIt
    1. Show me when you are done with #4
    2. Show me BOTH of the optional activities as you finish them.
    3. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 8
  3. Send me a note stating what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:

  1. Understand variables and how they are used in programming

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-10_NEW
  2. DO: Lesson10_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 9
    2. Show me when you are done with #4–This is what it should look like: Finished White Rabbit Lesson 10
    3. Show me the optional activity when you finish it.
    4. Send me a note stating what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:
  1. Use keyboard controls to manipulate an animation

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-11_NEW
  2. DO: Lesson11_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 10
    2. Show me when you are done with #4–Here is what it should look like: Finished White Rabbit Lesson 11
    3. Show me BOTH of the optional activities as you finish them.
  3. Send me a note stating what you learned today. 3-5 sentences.
GOAL: Before you leave today you will know how to:
  1. Use functional decomposition to write a scenario and storyboard
  2. Complete an animation
  3. Test an animation
  4. Re-position objects at run-time
  5. Plan the presentation of a completed animation project

RIGHT NOW:

  1. READ these slides for understanding and refer back to it when you are doing your assignment: Alice_Lesson-12_NEW
  2. DO: Lesson12_TryIt
    1. You can use this file if you didn’t finish the one from last class: Finished White Rabbit Lesson 11
    2. Show me when you are done with #6
    3. MAKE SURE YOU ARE MEETING THE REQUIREMENTS IN THE GRADING RUBRIC AT THE BOTTOM!!!
  3. Send me a note stating what you learned today. 3-5 sentences.
YOU HAVE TODAY AND NEXT CLASS TO FINISH THIS!!ALICE EXAM:2017 FBLA National Leadership Conference Topic:Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.Here is how you will be scored (there are 2 pages–production & presentation):
Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

YOU CAN HAVE MORE THAN 1 SCENE:

  1. Create each scene in Alice and save each one separately.
  2. In Alice, click FILE and choose UPLOAD TO YOUTUBE
  3. RECORD and STOP
  4. Click NEXT
  5. Click EXPORT VIDEO TO FILE
  6. Go on the Internet
  7. Go to Youtube
  8. Click on UPLOAD
  9. Upload both files
  10. Use the CREATOR in Youtube to combine the videos.
  11. Here is an example: https://www.youtube.com/watch?v=6_T88C5mO8I

In a Google Doc shared with me, tell me how far you got today and what questions you have.

YOU HAVE TODAY TO FINISH THIS!!

ALICE EXAM:

2017 FBLA National Leadership Conference Topic:

Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

YOU CAN HAVE MORE THAN 1 SCENE:

  1. Create each scene in Alice and save each one separately.
  2. In Alice, click FILE and choose UPLOAD TO YOUTUBE
  3. RECORD and STOP
  4. Click NEXT
  5. Click EXPORT VIDEO TO FILE
  6. Go on the Internet
  7. Go to Youtube
  8. Click on UPLOAD
  9. Upload both files
  10. Use the CREATOR in Youtube to combine the videos.
  11. Here is an example: https://www.youtube.com/watch?v=6_T88C5mO8I

In a Google Doc shared with me, tell me how far you got today and what questions you have.

YOU WILL BEGIN TO PREPARE TO PRESENT NEXT CLASS.

EXPORT EACH FILE AS A VIDEO FILE, PUT ALL OF YOUR SCENES TOGETHER USING YOUTUBE CREATOR STUDIO, AND PUBLISH THE VIDEO. SEND ME THE LINK.

  1. EXPORT: In Alice, click FILE and choose UPLOAD TO YOUTUBE
  2. RECORD and STOP
  3. Click NEXT
  4. Click EXPORT VIDEO TO FILE
  5. Go on the Internet
  6. Go to Youtube
  7. Click on UPLOAD
  8. Upload all files
  9. Use the CREATOR in Youtube to combine the videos.
  10. Here is an example: https://www.youtube.com/watch?v=6_T88C5mO8I

In a Google Doc shared with me, tell me how far you got today and what questions you have.

PREPARE TO PRESENT–YOU HAVE TODAY AND NEXT CLASS TO PREPARE TO PRESENT

Here is how you will be scored (there are 2 pages–production & presentation–FOCUS ON THE PRESENTATION PAGE–You need to talk about the process you took to create your project and talk about what you learned about programming from using Alice.):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

In a Google Doc shared with me, tell me how far you got today and what questions you have.

PREPARE TO PRESENT–PRESENT NEXT CLASS

Here is how you will be scored (there are 2 pages–production & presentation–FOCUS ON THE PRESENTATION PAGE–You need to talk about the process you took to create your project and talk about what you learned about programming from using Alice.):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

In a Google Doc shared with me, tell me how far you got today and what questions you have.

You have today and the next class to CREATE this.

ALICE EXAM:

2017 FBLA National Leadership Conference Topic:

Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

RIGHT NOW:

Create a Google Doc that describes the main GOAL of your project. Also, create a storyboard to get started. Share it with me.

YOU CAN HAVE MORE THAN 1 SCENE:

  1. Create each scene in Alice and save each one separately.
  2. In Alice, click FILE and choose UPLOAD TO YOUTUBE
  3. RECORD and STOP
  4. Click NEXT
  5. Click EXPORT VIDEO TO FILE
  6. Go on the Internet
  7. Go to Youtube
  8. Click on UPLOAD
  9. Upload both files
  10. Use the CREATOR in Youtube to combine the videos.
  11. Here is an example: https://www.youtube.com/watch?v=6_T88C5mO8I

FINISH CREATING THIS TODAY

ALICE EXAM:

2017 FBLA National Leadership Conference Topic:

Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

RIGHT NOW:

Continue to work on your project. At the end of class share with me what you accomplished and what you still need to do. Has your game/story/goal changed? How? Explain. You have today and the next 2 classes to finish it.

YOU CAN HAVE MORE THAN 1 SCENE:

  1. Create each scene in Alice and save each one separately.
  2. In Alice, click FILE and choose UPLOAD TO YOUTUBE
  3. RECORD and STOP
  4. Click NEXT
  5. Click EXPORT VIDEO TO FILE
  6. Go on the Internet
  7. Go to Youtube
  8. Click on UPLOAD
  9. Upload both files
  10. Use the CREATOR in Youtube to combine the videos.
  11. Here is an example: https://www.youtube.com/watch?v=6_T88C5mO8I

PLAN PRESENTATION

ALICE EXAM:

2017 FBLA National Leadership Conference Topic:

Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

RIGHT NOW:

Review the PERFORMANCE portion of the grading rubric above and PLAN your presentation.

PRACTICE PRESENTING

ALICE EXAM:

2017 FBLA National Leadership Conference Topic:

Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

RIGHT NOW:

PRACTICE PRESENTING

MAKE FINAL ADJUSTMENTS

2017 FBLA National Leadership Conference Topic:

Many companies are required to protect the environment and “go green.” Use 3-D animation in a promotional/marketing video to show the importance of going green as an important business sustainability step.

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

PRESENTATION DAY!!!

 

SHARE YOUR PUBLISHED 3D VIDEO WITH MRS. WEBER TODAY

PLEASE FILL OUT THE TEACHER EVALUATION FORM. THANKS!

LAST DAY–In the Comments box on the Web Apps & Coding webpage, please write a good course description that accurately reflects what you learned in this class and will make someone want to take this class

PRESENT

Here is how you will be scored (there are 2 pages–production & presentation):

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

Download [148.34 KB]

THIS IS FOR A TEST/PROJECT GRADE. YOU HAVE TODAY AND TOMORROW TO WORK ON THIS:
Create a new Alice program.
We will view & critique each others programs next class.
This is the final project for Alice.

MIDTERM TEACHER EVALUATION

THIS IS FOR A TEST/PROJECT GRADE. YOU HAVE TODAY TO WORK ON THIS:
Create a new Alice program.
We will view & critique each others programs at the end of this class.
This is the final project for Alice.
THIS IS FOR A TEST/PROJECT GRADE. YOU HAVE TODAY TO WORK ON THIS:
Create a new Alice program.
We will view & critique each others programs at the end of this class.
This is the final project for Alice.
Here is how you will be scored:
  1. Creativity
  2. Functions–does it work correctly?
  3. Motions–do they make sense? are they realistic?
  4. Time–too short? too long?
  5. Purpose–is it obvious or is it totally random?

Leave a Reply

Your email address will not be published. Required fields are marked *