## Teaching Thinking with ScratchScratch is an amazingly powerful, yet simple to use, programming language for young students. It brings together mathematical ideas, computational thinking, art and design, as well as creative and logical problem solving. It engages students in higher order thinking in a cleverly structured and fun to use environment. It has applications in just about every curriculum area, and can be used with children as young as kindergarten, right though to high school. While Scratch has been around for a few years, the current version is quite different from the way it started out. It is easier to use, is better designed, delivers even more computational thinking concepts, and runs entirely in a web browser. If you have never used Scratch before, or have not made the move to Scratch 2.0, this session is for you! We cover the basics of Scratch, and will quickly get you up to speed with its key ideas and get you creating simple programs and games that might surprise you. Notes: This is a hands on practical session, so bring a laptop with a modern browser and expect to do some work! ## Activity 1 - Fun with PolygonsIn this first activity we will write a simple script for drawing a square (using a technique similar to that used in the Logo programming language). We will then modify that script to try and come up with a general formula which could describe ALL polygons. Then we will have some fun with this idea and create interesting circular patterns. - Create a script to describe the steps for drawing a square
- Simply the steps to as few instructions as possible.
- Control the speed and line tracing
- Make the code run by pressing the "s" key.
- Duplicate the square code 5 times and make the following modifications
- press "h" to draw a hexagon
- press "o" to draw an octagon
- press "t to draw a triangle
- press "c" to draw a circle
- press "p" to draw a pentagon
- press "r" to reset (clear) the stage
- What is the underlying mathematical pattern?
- How could we come up a single generalised script that could draw
**any**n-sided polygon?
Extension 1: Draw any polygon, then turn by an additional amount before drawing it again, repeating until the set of polygons have rotated a full 360 degrees. Hint, place a loop inside a loop. How many repetitions do you need to do to complete the full pattern? What is the relationship between the number of repetitions and the turn angle between repetitions?Extension 2: Can you write a program that asks the user to type in any number 1-10 so it then draws a shape with that many sides? ## Activity 2 - Random Racing- Create a new sprite to act as the finishing line by drawing a vertical line, then place it at the right side of the stage.
- Make a sprite do the following...
- move 10 steps at a time
- do this until it touches the finish line
- when it touches the finish line it reacts, then stops
- Modify the sprite to move by a random number of steps instead of a fixed amount
- Duplicate the sprite to create a set of characters that will race each other to the finish line
Extension 1: Work out how to return the sprites to the "starting line" in order to restart the race. Hint: each sprite's position is controlled by an x,y coordinate. Add a script to each sprite so that pressing the "r" key (reset) will return the sprites to their start positions.Extension 2: Work out how to create a "starting marshall" sprite so that when you click this character, the race begins. Maybe they could say "ready, set, go" to start the race.## Activity 3 - Maze MagicThis project forms the start of a simple maze game. You will start by scripting the core logic for the game, then gradually iterate and improve the game with your ideas for making it more interesting and more challenging. - Draw a maze design on the stage background. Keep it reasonably simple to start with.
- Create a sprite that does the following...
- Moves 10 steps to the right when the right arrow key is pressed
- If it comes into contact with the edge of the maze path, it responds and takes a step backwards
- Return the sprite to the start of the maze
- Duplicate the sprite's script to account for additional key presses to the left, up and down
- Add a reward sprite at the end of the maze
- Create a "success reaction" when the movable sprite comes into contact with the reward sprite
Extension 1: How could you make this game more interesting? Discuss your ideas with a partner. Implement at least one of your ideas for improving the game.Extension 2: Design a system to keep score. ## Activity 4 - New Tricks for Old DogsWorking with variables is a really important part of learning to program. This activity needs you to ask for a number, and to change that number using a mathematical action. - Create a dialog between two characters - a person and a dog. The person asks how old you are, and the user of the computer types an answer.
- The dog replies with that same answer converted to dog years. (There are 7 dog years for every human year)
Extension 1: Make the person comment on the dog's age with a different answer depending on the age.## Activity 5 - Art for Art's SakeCreate a script that uses randomness to create interesting patterns on the screen. As suggestions, try using some of the following block elements... - x,y coordinates
- randomness
- pen colour
- repeats
- turning
- moving
- pen up/down
- pen thickness
- any other blocks you want to try!
There's no right or wrong to this... just use your imagination and see what you come up with! Make it pretty! ## Activity 6 - MindreaderCombine all of the above ideas in one program. This one needs loops, variables, conditional responses, input and output, all working together. Just like a real computer program. - Make the computer "think" of a number between 1 and 100.
- The user has to guess the number.
- If they guess too high, the computer says "lower".
- If the guess too low, the computer says "higher".
- When they guess the number, the computer congratulates them on getting it correct.
Extension 1: Keep track of the number of guesses the user makes.Extension 2: Limit the number for guesses the user is allowed to makeExtension 3: Come up with a scoring system that gives you a score based on how few guesses you takeExtension 4: Make the computer celebrate when you get it right## Activity 7: Where's the Maths?Take this survey about where Scratch might be useful to help teach the new Australian Mathematics Curriculum. |