# Computer Science 1 Syllabus

## Classroom Contact Information

#### Teacher: Mr. Poston

Email: <john.poston@risd.org>\
Phone: 469-593-3084

## Course Description

This course uses Snap!, a blocked-based programming environment, and transitions to Python, a text-based programming language.\
Computing has changed the world in profound ways: it has opened wonderful new ways for people to connect, design, research, play, create, and express themselves. However, using the computer is just a small part. This course is an introductory programming course that helps prepare students for more advanced programming courses. We will use Snap!, an approachable, visual, block-based programming language, with a robust tool set, perfect for introducing students to code for the first time. Snap! is taught during the first semester of the full year course. In second semester, students will benefit from exposure to a Python-based programming curriculum.

### Prerequisites

This course is designed for students with algebra readiness skills. No prior programming experience is required.

## Supplies and Expectations

### Class Supplies

* Pen or pencil
* Paper
* A good attitude

### Class Expectations

* Arrive to class on time
* Be prepared to learn
* Work hard and learn from your mistakes
* Follow the posted classroom expectations

### Grading Categories

Minor Grades: 40%\
Major Grades: 60%

### Late Work Policy

An absent student is allowed one make-up day for each absence, plus one day. The assignment is penalized ten points for each day thereafter. A student who knowingly submits a late assignment will be penalized ten points each day after the due date.

## Curriculum - Semester 1

### Unit 0: Beginnings

| Lesson                     | Objectives                                                                                                                             |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| 0.1 The First Day          | Identify the class they are taking. List the high-level goals of the course. Describe classroom procedures, rules, and norms.          |
| 0.2 Algorithms             | Define “algorithm.” Construct algorithms for performing simple tasks.                                                                  |
| 0.3 Programming Languages  | Complete the Minecraft Adventurer lab from code.org with guidance. Explain why computer programs are written in specialized languages. |
| 0.4 Snap Self Portrait     | Create a simple "program" in Snap! to describe yourself.                                                                               |
| 0.5 Snap Coordinate System | Create a drawing using the Snap! Coordinate System.                                                                                    |

### Unit 1: Snap! Basics

| Lesson                   | Objectives                                                                                                                                                                                               |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 1.1 Welcome to Snap!     | Define and identify “blocks,” “scripts,” “sprites,” and “the stage” in SNAP. Write simple SNAP programs. Describe what simple SNAP programs do without executing the code.                               |
| 1.2 Building Blocks      | Name the categories of blocks in SNAP and describe what the blocks in each category do. Describe the function of several common SNAP blocks. Be able to use common blocks to build simple SNAP programs. |
| 1.3 Drawing Shapes       | Construct simple algorithms to draw shapes. Convert algorithms into SNAP programs.                                                                                                                       |
| 1.4 Animation            | Animate SNAP sprites using costume changes and movement. Trigger action in other sprites using broadcasts.                                                                                               |
| 1.5 Storytelling Project | Apply basic programming and SNAP skills to create an animated movie, play, nursery rhyme, or other scene. Practice good debugging skills to correct issues as they arise while programming               |

### Unit 2: Loop-de-Loop

| Lesson                      | Overview                                                                                                                                                             |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2.1 Loops                   | Define “loop” in a programming context. Explain why loops are useful. Implement simple repeat and forever loops in SNAP. Utilize loops to reduce redundancy in code. |
| 2.2 Nested Loops            | Use nested loops to solve programming problems.                                                                                                                      |
| 2.3 Inputs and Conditionals | Ask for and receive user input in a SNAP program. Use simple conditional (if and if-else) blocks to alter control flow in a SNAP program.                            |
| 2.4 Variables               | Use variables to track values throughout a program.                                                                                                                  |
| 2.5 Boole in the House      | Define and identify Boolean expressions and operators. Evaluate Boolean expressions. Utilize Boolean operators (and/or/not) to create compound conditions.           |
| 2.6 Pong Project            | Implement a well-written version of Pong. Practice good style and conventions to create readable and maintainable code.                                              |

### Unit 3: Variables and Customization

| Lesson                                         | Objectives                                                                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 3.1 Abstraction and Generalization             | Define abstraction, detail removal, generalization, and procedural decomposition in a computer science context. Describe how utilizing procedural decomposition can improve the readability and maintainability of algorithms and/or code. Recognize opportunities to improve algorithms by abstracting or generalizing parts into sub procedures. |
| 3.2 Combining Loops and Conditionals           | Build custom command blocks in Snap. Utilize detail removal and generalization to construct blocks that practice abstraction.                                                                                                                                                                                                                      |
| 3.3 Customization I: Arguments                 | Build custom command blocks in Snap. Utilize detail removal and generalization to construct blocks that practice abstraction.                                                                                                                                                                                                                      |
| 3.4 Customization II: Reporters and Predicates | Build custom reporter and predicate blocks in SNAP.                                                                                                                                                                                                                                                                                                |
| 3.5 Platform Game Project                      | Use loops, variables, and Boolean expressions to implement a Super Mario Bros. style platform game. Practice good debugging skills to correct issues as they arise while programming.                                                                                                                                                              |

### Unit 4: Lists

| Lesson                         | Objectives                                                                                                                                                                            |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 4.1 Intro to Lists             | Explain the concept of a “list” in a programming context. Identify scenarios in which lists are useful                                                                                |
| 4.2 Static Lists               | Create static lists in SNAP. Access elements of a list. Add and remove elements from a list.                                                                                          |
| 4.3 List Practice I            | Traverse a list, accessing each element one at a time. Perform operations combining all elements in a list. Select defined subsets of elements in a list.                             |
| 4.4 List Practice II           | Traverse a list, accessing each element one at a time. Perform operations combining all elements in a list. Select defined subsets of elements in a list.                             |
| 4.5 Sequential Search          | Explain the sequential search algorithm. Implement several variations of sequential search.                                                                                           |
| 4.6 Word Guessing Game Project | Use lists to implement a complete version of a word guessing game. Exercise good programming practices to produce code that is not only functional but also elegant and well-written. |

### Unit 5: Cloning

| Lesson                        | Objectives                                                                                                                                                                                                                                                                                                  |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 5.1 Intro to Cloning          | Explain why prototyping and clones can be useful. Describe how complex goals can be accomplished using cloning.                                                                                                                                                                                             |
| 5.2 Cloning Sprites           | Demonstrate the difference between sprite and global variables. Explain how cloning and prototyping simplify working with numerous similar sprites in the same program. Create prototype sprites and clones of the prototype sprite. Explain the difference between a “master” sprite and a “clone” sprite. |
| 5.3 Communicating with Clones | Pass information to individual clones. \[Optional] Describe a race condition that might occur due using global variables and clones. Delete clones when they are no longer needed.                                                                                                                          |
| 5.4 Space Invaders            | Use cloning to implement a complete version of “Space Invaders.” Exercise good programming practices to produce code that is not only functional but also elegant and well-written.                                                                                                                         |

### Unit 6: Final Snap! Project

| Lesson                           | Objectives                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 6.1 Design Basics                | Identify the key considerations when designing a piece of software. Describe methods for prioritizing features, use cases, and/or scenarios. Explain why design and planning are necessary steps in the software engineering process.                                                                                                      |
| 6.2 Brainstorming and Evaluating | Identify factors to use when choosing between project ideas. Rank a group of proposed project ideas using the identified factors.                                                                                                                                                                                                          |
| 6.3 Spec Writing                 | Identify the main components of a functional project specification and explain the purpose of each section. Develop a project idea into a full, detailed specification                                                                                                                                                                     |
| 6.4 Building a Plan              | Identify the main components of a functional project specification and explain the purpose of each section. Develop a project idea into a full, detailed specification.                                                                                                                                                                    |
| 6.5 Project Implementation       | Use the skills developed throughout the course to implement a medium- to large-scale software project. Realistically evaluate progress during software development and identify when cuts are necessary. Prioritize features and scenarios and choose which should be eliminated or modified if/when resources and/or time become limited. |

## Curriculum - Semester 2

### Unit 7: Introduction to Python

| Lesson                        | Objectives                                                                                                                                                                                                                                                              |
| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 7.1 Set Up                    | Define and identify: IDE, Python. Identify the key concepts that will be covered in the course. Set up and log into an account for the course's online IDE. Save and turn in a file via the online IDE.                                                                 |
| 7.2 Interactive Mode          | Define and identify interpreter, string (`str`), integer (`int`), float (`float`), value, errors, console, expression. Use the Python interpreter to evaluate simple math expressions. Distinguish between an integer, float, and string.                               |
| 7.3 Script Mode and Variables | Define and identify script, `print`, run, output, variable. Write a simple script and run it in the IDE. Print values out to the console (both composed values and from variables). Compare script mode vs interactive mode. Know how to store a value into a variable. |
| 7.4 Variables Input           | Define and identify comments, storing, mutability, variable assignment, `input`. Assign and swap variables. Store user input into a variable.                                                                                                                           |
| 7.5 Debugging                 | Demonstrate your understanding of key concepts covered up to this point. Define and identify debugging, syntax errors. Analyze and respond to error messages.                                                                                                           |
| 7.6 Madlibs Project           | Apply basic Python knowledge about inputs/outputs and variables to create a game of Madlibs. Practice good debugging skills.                                                                                                                                            |

### Unit 8: Data Types and Conditionals

| Lesson                     | Objectives                                                                                                                                                                                |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 8.1 Data Types and Casting | Define and identify type, string, casting, floating point number (float), integer. Describe different representations of data in Python. Convert from one data type to another data type. |
| 8.2 Booleans & Expressions | Define and identify Boolean, expression, composition, `True`, `False`. Evaluate a Boolean expression. Compose Boolean expressions using `and`, `or`, `not`, `<`, `>`, and `==`.           |
| 8.3 Conditionals           | Define and identify: `if`, `else`, `elif`, conditionals, flow of control. Create chaining `if` statements. Understand how conditional statements alter the flow of control of a program.  |
| 8.4 Lists                  | Define and identify list, item, index, integer. Be able to access items from a list using the index. Create lists of different types. Use the length function.                            |
| 8.5 Lists 2                | Define and identify slice, append, pop, remove. Slice a list. Add and remove elements from a list                                                                                         |
| 8.6 Game Loop              | Define and identify while loop. Use a while loop to simulate game play.                                                                                                                   |
| 8.7 Adventure Game Project | Use knowledge of lists, Booleans, conditionals, and while loops to create a text-based adventure game.                                                                                    |

### Unit 9: Functions

| Lesson                     | Objectives                                                                                                                                                                                                                                                                                               |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 9.1 Built-In Functions     | Define and identify function, arguments, calling, importing, returning. Call the built-in `randint` function, using arguments. Utilize code other people have written in the Python documentation. Understand the difference between printing and returning.                                             |
| 9.2 User-Defined Functions | Define and identify abstraction, def. Create functions.                                                                                                                                                                                                                                                  |
| 9.3 Return vs. Print       | Define and identify: return, none, void. Explain and demonstrate the difference between printing and returning.                                                                                                                                                                                          |
| 9.4 Debugging and Scope    | Define and identify scope, aliasing, stack trace. Understand that changing a list in a function updates the list outside of the function. Understand that updating variables in a function does not affect the variable outside of the function. Understand global variables. Draw a simple stack trace. |
| 9.5 Project                | Use project planning skills to complete a longer-term project. Create functions to organize a project. Apply skills learned in units 7-9 to create a functioning program.                                                                                                                                |

### Unit 10: Nested Loops and Lists

| Lesson                      | Objectives                                                                                                                                                                                                                                |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 10.1 Looping Basics         | Define and identify `for` loop, item, iteration, scope. Recall looping in Snap! and reapply the concept in Python. Loop through (traverse) the items in a list. Be aware of the scope of variables during iteration.                      |
| 10.2 For Loops              | Define and identify `range`. Use the `range` and `len()` function to update lists via `for` loops.                                                                                                                                        |
| 10.3 Nested For Loops       | Define and identify nested `for` loops, stack trace. Use nested `for` loops via a function and a `for` loop. Use nested `for` loops via two loops nested. Use a stack trace to understand and demonstrate the flow of nested `for` loops. |
| 10.4 Nested Lists & Looping | Define and identify nested list. Use nested `for` loops to traverse through nested lists.                                                                                                                                                 |
| 10.5 Debugging              | Read and understand longer programs involving loops. Demonstrate knowledge of looping, lists, and nested loops/lists. Debug programs involving for loops and lists.                                                                       |
| 10.6 Tic-Tac-Toe Project    | Use project planning skills to complete a larger project. Utilize loops, lists, and nested loops/lists to create a Tic-Tac-Toe game.                                                                                                      |

### Unit 11: Dictionaries

| Lesson                            | Objectives                                                                                                                          |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| 11.1 Introduction to Dictionaries | Define and identify dictionary, key, value. Create dictionaries of key-value pairs. Access and update items from dictionaries.      |
| 11.2 Dictionaries Methods         | Define and identify pop, default value. Update values in a dictionary. Add values to a dictionary. Remove values from a dictionary. |
| 11.3 Dictionaries of Lists        | Create dictionaries with keys and values of different types. Update, append, or remove list values in a dictionary.                 |
| 11.4 Dictionaries Looping         | Use loops to traverse through key/value pairs in a dictionary.                                                                      |
| 11.5 Guess Who Project            | Use dictionaries to create the game Guess Who.                                                                                      |

### Unit 12: Introduction to Object Oriented Programming

| Lesson                          | Objectives                                                                                                                                                                                      |
| ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 12.1 User-Defined Types         | Define and identify class, instance, object, attributes. Create a class and instantiate. attributes to an instance. Manipulate instances and attributes through a function.                     |
| 12.2 User-Defined Types, Part 2 | Define and identify `self`, `__init__`. Create a class with an `__init__` method. Understand and use the `self` argument. Instantiate a class with arguments                                    |
| 12.3 Methods                    | Define and identify method, `__str__`, `__add__`, operator overloading. Create a class with an `__init__` method. Understand and use the `self` argument. Instantiate a class with an argument. |
| 12.4 Inheritance                | Define and identify inheritance, parent class, child class. Create a class that inherits from anther class. Overwrite methods of parent class in a child class.                                 |
| 12.5 Pokemon Project            | Engage in class design before beginning coding. Apply what was learned with respect to classes, methods, and inheritance to create an implementation of Pokemon.                                |

### Unit 13: Final Project

| Lesson                                          | Objectives                                                                                                                                                                                                                                                                                                                                 |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 13.1 Final Project Brainstorming and Evaluating | Recall project planning basics from last semester. Identify factors to use when choosing between project ideas. Rank a group of proposed project ideas using the identified factors.                                                                                                                                                       |
| 13.2 Defining Requirements                      | Define key scenarios for a project and the features required to implement each scenario. Explain the importance of wireframing when designing an application.                                                                                                                                                                              |
| 13.3 Building a Plan                            | Identify the main components of a functional project specification and explain the purpose of each section. Develop a project idea into a full, detailed specification.                                                                                                                                                                    |
| 13.4 Project Implementation                     | Use the skills developed throughout the course to implement a medium- to large-scale software project. Realistically evaluate progress during software development and identify when cuts are necessary. Prioritize features and scenarios and choose which should be eliminated or modified if/when resources and/or time become limited. |

### Unit 14: Music Programming

| Lesson                                | Objectives                                                                                                                                                                                                            |
| ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 14.1 EarSketch Intro                  | Define and identify: Digital Audio Workstation (DAW), sound tab, `fitMedia()`, `setTempo()`. Play beats using the above functions. Loop through items in a list. Be aware of the scope of variables during iteration. |
| 14.2 EarSketch Music                  | Define and identify: rhythm, beat, tempo, measures, `setEffect()`, `makeBeat()`. Play beats using the functions. Loop through items in a list. Be aware of the scope of variables during iteration.                   |
| 14.3 EarSketch Control Flow           | Define and identify modulo (`%`). Review looping and control structures. Use looping concepts in music making via EarSketch. Use control structures to create music.                                                  |
| 14.4 EarSketch User-Defined Functions | Define and identify abstraction, section, A-B-A form. Create and apply user-defined functions to create songs with complicated form.                                                                                  |
| 14.5 EarSketch Project                | Create a complete song in EarSketch with multiple parts. Utilize EarSketch's features and functions.                                                                                                                  |
