Intro to Programming With Snap PII
Warm Up: What is the difference between these 3? count from 11 to 99 skips 20, 30, 40 ..etc count from 0 to 99 Counts from 1 to 99 skips 0, 10, 20, etc
Can you make one that counts from 100 down by 10s? counts down from 100 to 0 by 10s (first number it assesses is 109 but 109 is NOT divisible by 10)
Make a page of Notes: What is modular arithmetic “Clock Math”?
The remainders start at 0 and increases by 1 each time, until the number reaches one less than the number we are dividing by. After that, the sequence repeats. By noticing this, we can visualize the modulo operator by using circles. We write 0 at the top of a circle and continuing clockwise writing integers 1, 2, ... up to one less than the modulus.
15 mod 12 = ___ 24 mod 12 = ____ 57 mod 12 = ____ 60 mod 12 = ____ 9 15 mod 12 = ___ 24 mod 12 = ____ 57 mod 12 = ____ 60 mod 12 = ____ 3
3 3 2 2 18 18
Game on Kahn Academy https://www.khanacademy. org/computing/computer- science/cryptography/moda rithmetic/p/modulo- challenge
Practice Questions (just do top 4 today) Sprite is in the middle of the scripting area. Points to the right (90°). Screen is cleared When the green flag is clicked, the sprite will follow the mouse. Spiraling triangle thing… If sprite is NOT facing 90 degrees, it will turn until it faces 90 degrees, 1 degree and 1 step at a time.
Assignment 2: Maze Projects with a Partner Big Idea: Abstractions and Creativity
EXs of a Basic Maze
CSP Maze Partner Project
OR http://tinyurl.com/APCPSrubric http://tinyurl.com/mazeprojectpalosaari OR
Maze Game Maze resources and these following slides (PPT, PDF) are available at: http://tinyurl.com/sample- mazeGame
Help Getting Started Use blocks to begin your game and accomplish the following: enable your game to start with pressing of green flag move sprite to starting point move sprite back if he touches a wall set use of arrow keys accomplish the red square for winning maze “red box” target (if your target is different; make adjustments)
Maze Resources maze-resources.zip (http://tinyurl.com/sample-mazeGame)
Step 1 Set up the sprite (use your own), stage costumes (make your own) and sound
Step 2 Write the the program script for the Sprite enable your game to start with pressing of green flag move sprite to starting point move sprite back if he touches a wall set use of arrow keys accomplish the red square for winning maze “red box” target (if your target is different; make adjustments)
Step 3 Write the the program script for the Stage
SNAP! Assigns direction as follows: ***Locations on the stage (the white rectangle where sprites perform their scripts) are specified by (x,y) coordinates. The center of the stage is (0, 0). The left edge is x = -240; the right edge is x = 240. The bottom is y = -180 The top is y = 180
Debugging Advice
Debugging Cont.
Paired Programing At the keyboard Driver Navigator At the keyboard Implements the next task provided by the navigator. Gives future tasks to the navigator to track. Answers navigators questions. Keeps track of the big picture. Responsible for directing the flow of work to a specific conclusion. Reviews code. Keeps track of tasks identified by the driver so they can focus on coding. Ensures that best practices are followed. Track potential code improvements. Asks questions about the driver’s implementation