CS in Algebra

Code.org Curriculum Framework
Lesson 1: Video Games and Coordinate Planes
Overview Students discuss the components of their favorite video games and discover that they can be reduced to a series of coordinates. They then explore coordinates in Cartesian space, identifying the coordinates for the characters in a game at various points in time. Once they are comfortable with coordinates, they brainstorm their own games and create sample coordinate lists for different points in time in their own game.
Objectives
• Create a data model that describes a simple video game.
• Describe the movements of videogame characters by their change in coordinates.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.5 , 6.NS.8 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .
CSTA K-12 Computer Science Standards: CT.L1:6-01 , CT.L2:14 .

Lesson 2: Evaluation Blocks and Arithmetic Expressions
Overview Students will begin using Evaluation Blocks to explore the concept of math as a language, and more specifically, a programming language. By composing arithmetic expressions with Evaluation Blocks, students will be able to visualize how expressions follow the order of operations.
Objectives
• Convert arithmetic expressions to and from code.
• Use Evaluation Blocks to reflect the proper order of operations for an expression.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.5 , 6.NS.6 , 6.NS.8 , 6.EE.2 , A.SSE.1 , A.SSE.2 , A.SSE.4 , A.REI.1 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 3: Strings and Images
Overview To compute more than just numbers, students will need to learn about two new data types, Strings (any string of alphanumeric characters) and Images. Using these new data types, we'll compose programs that produce and manipulate images.
Objectives
• Write and evaluate expressions for generating Strings and Images.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , A.SSE.1 , A.SSE.2 , A.SSE.4 , A.REI.1 , F.IF.1 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 4: Contracts, Domain, and Range
Overview Contracts provide a way for students to better understand and discuss functions. Through this lesson, students will look at known functions and come up with the contracts that describe those functions.
Objectives
• Describe a function in terms of its name, domain, and range.
• Create contracts for arithmetic and image-producing functions.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , A.SSE.1 , A.SSE.2 , F.IF.1 , F.IF.2 , F.IF.3 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 5: Writing Contracts
Overview Students will work their way through a number of new functions, first using each to solve a problem, and then writing a contract which describes it.
Objectives
• Decompose existing functions.
• Write contracts that describe functions.
• Experiment with basic geometric transformations.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.G.1 , A.SSE.1 , A.SSE.2 , F.IF.1 , F.IF.2 , F.IF.3 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 6: Defining Variables and Substitution
Overview In this activity, students will learn to define variables that can be used to reference values and expressions. Once defined, their variables can be used repeatedly throughout a program as substitutes for the original values or expressions.
Objectives
• Define variables by giving them a name and assigning them a value or expression.
• Use variables within Evaluation Blocks.
• Describe a situation where using variables as substitutions for values or expressions is more efficient.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.EE.4 , A.SSE.1 , A.SSE.2 , A.CED.1 , A.CED.2 , F.IF.1 , F.IF.2 , F.IF.3 , F.LE.1 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 7: The Big Game - Variables
Overview Students get their first look at the inside of their own video games. They will start development by substituting in new Images, Strings, and Numbers for existing variables.
Objectives
• Substitute new values into existing variables of an existing program and describe the effects.
• Examine the structure of an existing program.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.EE.4 , A.SSE.1 , A.SSE.2 , A.CED.1 , A.CED.2 , F.IF.1 , F.IF.2 , F.IF.3 , F.LE.1 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 8: Composite Functions
Overview In the past lessons students have defined variables which will allow them to easily write expressions that refer to the same value repeatedly. In this stage, they will write simple functions that, like variables, allow students to abstract out repetitious elements of their programs.
Objectives
• Analyze and use existing functions.
• Modify existing functions.
• Create new functions.
• Create similar shapes by changing size parameters on functions.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 7.G.1 , 8.F.1 , 8.F.2 , A.SSE.1 , A.SSE.2 , A.CED.1 , A.CED.2 , F.IF.1 , F.IF.2 , F.IF.3 , F.IF.4 , F.IF.5 , F.IF.6 , F.LE.1 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 9: The Design Recipe
Overview In the last stage, students wrote some very simple functions - but more sophisticated functions demand a more thoughtful approach. The Design Recipe is a structured approach to writing functions that includes writing test cases to ensure that the function works as expected. Once students have mastered the Design Recipe process, they can apply it to any word problem they encounter.
Objectives
• Use the Design Recipe to identify dependent variables, independent variables, and constants.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , A.CED.1 , A.CED.2 , A.CED.3 , A.CED.4 , F.IF.1 , F.IF.2 , F.IF.3 , F.IF.4 , F.IF.5 , F.IF.6 , F.IF.7 , F.IF.9 , F.BF.1 , F.BF.2 , F.LE.1 , F.LE.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 10: Rocket Height
Overview Using the Design Recipe, students will work through a series of word problems about calculating the height of a rocket after a given number of seconds from launch. The functions they write will be used to animate the rocket launch.
Objectives
• Design functions to solve word problems.
• Use the Design Recipe to write contracts, test cases, and function definitions.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , A.CED.1 , A.CED.2 , A.CED.3 , A.CED.4 , F.IF.1 , F.IF.2 , F.IF.3 , F.IF.4 , F.IF.5 , F.IF.6 , F.IF.7 , F.IF.9 , F.BF.1 , F.BF.2 , F.LE.1 , F.LE.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 11: Solving Word Problems with the Design Recipe
Overview Students will continue to practice the Design Recipe with a series of word problems.
Objectives
• Design functions to solve word problems.
• Continue to practice writing contracts with more complex scenarios.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , A.CED.1 , A.CED.2 , A.CED.3 , A.CED.4 , F.IF.1 , F.IF.2 , F.IF.3 , F.IF.4 , F.IF.5 , F.IF.6 , F.IF.7 , F.IF.9 , F.BF.1 , F.BF.2 , F.LE.1 , F.LE.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 12: The Big Game - Animation
Overview Returning to the Big Game we started in stage 7, students will use the Design Recipe to develop functions that animate the Target and Danger sprites in their games.
Objectives
• Design functions to solve word problems.
• Use the Design Recipe to write contracts, test cases, and function definitions.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , F.IF.1 , F.IF.2 , F.IF.4 , F.IF.5 , F.IF.6 , F.BF.1 , F.BF.2 , F.LE.1 , F.LE.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 13: Booleans and Logic
Overview Booleans are the fourth and final data type that students will learn about in this course. In this stage, students will learn about Boolean (true/false) values, and explore how they can be used to evaluate logical questions.
Objectives
• Evaluate simple Boolean expressions.
• Evaluate complex Boolean expressions.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , A.REI.3 , A.REI.10 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 14: Boolean Operators
Overview Using Boolean operators, students will write code that compares values to make logical decisions.
Objectives
• Use Boolean operators to compare values.
• Apply Boolean logic, such as AND, OR, and NOT, to compose complex Boolean comparisons.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 15: Sam the Bat
Overview Using Boolean operators, students will write code that checks the location of a sprite to make sure it doesn't go off-screen.
Objectives
• Use Boolean operators to compare values.
• Apply Boolean logic, such as AND, OR, and NOT, to compose complex Boolean comparisons.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 16: The Big Game - Booleans
Overview Using the same logic from the previous lesson, students will write code that checks whether their Target and Danger sprites have left the screen. If their function determines that a sprite is no longer visible on screen, it will be reset to the opposite side.
Objectives
• Use Boolean operators to compare values.
• Apply Boolean logic, such as AND, OR, and NOT, to compose complex Boolean comparisons.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 17: Conditionals and Piecewise Functions
Overview Currently, even when passing parameters to functions, our outputs follow a very rigid pattern. Now, suppose we want parameters with some values to create outputs using one pattern, but other values to use a different pattern. This is where conditionals are needed. In this stage students will learn how conditional statements can create more flexible programs.
Objectives
• Understand that piecewise functions evaluate the domain before calculating results.
• Evaluate results of piecewise functions.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 , F.IF.7.b .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 18: Conditionals and Update Player
Overview Using conditionals, students will write functions and programs that change their behavior based on logical evaluation of input values.
Objectives
• Use Boolean operators to compare values.
• Apply Boolean logic, such as AND, OR, and NOT, to compose complex Boolean comparisons.
• Write conditional statements that evaluate differently based on their input values.
Standards Common Core Math Standards: 5.OA.1 , 5.OA.2 , 6.NS.8 , 6.EE.9 , 7.EE.4 , 8.F.1 , 8.F.2 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 19: Collision Detection and the Pythagorean Theorem
Overview Determining when objects on the screen touch is an important aspect of most games. In this lesson we'll look at how the Pythagorean Theorem and the Distance Formula can be used to measure the distance between two points on the plane, and then decide whether those two points (or game characters) are touching.
Objectives
• Demonstrate that circles will overlap if the distance between their centers is less than the sum of their radii.
• Show that the distance of two points graphed in 2 dimensions can be represented as the hypotenuse of a right triangle.
• Understand that the Pythagorean Theorem allows you to calculate the hypotenuse of a right triangle using the length of the two legs.
• Apply the Pythagorean Theorem to calculate the distance between the centers of two objects.
Standards Common Core Math Standards: 6.NS.8 , 7.EE.4 , 8.EE.2 , 8.F.1 , 8.F.2 , 8.G.7 , 8.G.8 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .

Lesson 20: The Big Game - Collision Detection
Overview To finish up their video games, students will apply what they have learned in the last few stages to write the final missing functions. We'll start by using booleans to check whether keys were pressed in order to move the player sprite, then move on to applying the Pythagorean Theorem to determine when sprites are touching.
Objectives
• Apply the Distance Formula to detect when two points on a coordinate plane are near each other.
Standards Common Core Math Standards: 6.NS.8 , 7.EE.4 , 8.EE.2 , 8.F.1 , 8.F.2 , 8.G.7 , 8.G.8 .
Common Core Math Practices: MP.1 , MP.2 , MP.3 , MP.4 , MP.5 , MP.6 , MP.7 , MP.8 .