Introduction to Coding ENG 2P Unit: The Hero’s Journey Ms. DeJong
Coding uses a specific set of instructions – called “algorithms” Step-by-step processes needed to solve problems and/or to complete a task
Algorithm Action: learning the coding language The sprite is the character that does the movement in the game. Today it is YOU! You should only do what the If action tells you to do IF the condition is true! Otherwise, skip to the next Else If If NONE of the If conditions are true complete the Else action instead A Loop means to repeat an action any number of times (as shown)
Algorithm Action: Lets practice! Wait (10 seconds) If 12 - 4 = 8 Then Do 10 Jumping Jacks Else Do 8 Squats End If Wait (10 seconds) If you have at least 1 pet Then Clap 5 times Else Do 3 lunges End If selection
Algorithm Action: Lets practice! Wait (10 seconds) If your first name begins with A to L Then Stomp your left foot on the ground 5 times Else If your first name begins with M to Z Then Hop using your right leg 5 times Else Spin around 3 times End If Selection
Algorithm Action: Lets practice! Wait (10 seconds) Do until teacher says stop If your favourite subject is phys. Ed Then Run on the spot Else If your favourite subject is science Then Do the Macarena dance Else Tap your hands on your knees End If End Do Selection, repeition
Algorithm Action: Lets practice! Wait (10 seconds) If you are wearing black Then Loop 5 times Wait 1 second Touch your toes End Loop Else Loop 10 times End IF Selection, repetition via loop (patterns)
Algorithm Action: Lets practice! Wait (10 seconds) Do while teacher is standing If teacher points up Then Jump as high as you can Else If teacher points down Then Touch your toes Else Stay standing End If End Do
Playing with Scratch An online coding software
Instructions Visit https://scratch.mit.edu Click “Join Scratch” in the left corner – enter an email & create a password for the website! Select the “Create” tab on the upper left of the page (a new screen with a Cat should pop up) Cat = the sprite (or character) in the game Select “Events” and add button onto your page by dragging it
Learn through discovery Play around with the different effect blocks of Scratch Try to make Scratch move in a straight line and turn Try to get Scratch to draw with his pen CHALLENGE #1: Code the cat to draw a square!
What Type of shape will these codeS make? Square Circle Octagon