Shape Calculator. Creating your own graphics
What is it? 1. Draw a vertical line 2. Draw a horizontal line across it 3. Draw a diagonal line from the top of the vertical to the tip of the horizontal line 4. Repeat instruction 3 for all remaining corners 5. Draw a wavy line from the bottom tip
What is it? 1. Draw a vertical line 2. Draw a horizontal line across it 3. Draw a diagonal line from the top of the vertical to the tip of the horizontal line 4. Repeat instruction 3 for all remaining corners 5. Draw a wavy line from the bottom tip
What Went Wrong? Why didn t you guess the answer? Why was everybody s response different? The instructions could have been better if: > they were clearer > more precise
Marching Orders What happened if we always followed instructions exactly as they were said? What would happen if you pointed to a closed door and said, Go through that door? Computers work by following lists of instructions, and they do exactly what the instructions say even if they don t make sense!
Marching Orders 1 Volunteer needed The volunteer will see an image that you can t. They will read out instructions to help you draw the image. Follow the instructions exactly! Round 1: You can ask questions Round 2: NO Questions allowed
Your Turn Think of an image made of geometric shapes. On the first page, draw your image e.g. Kite, flower, house etc. On the second page write out the instructions that would help someone else draw that image.
Your Turn Swop instructions with a partner Recreate their image based on the instructions given Compare images How good were their instructions? How could the instructions be improved?
The Computer s Turn! What types of instructions did you use? We re going to develop a program that will be able to make your drawing for you Find and open Scratch Are you familiar with the software? Can you tell me how to use it?
Session 2 BUILDING OUR SKILLS
The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions are stored. The SPRITES are where you store and select the STAGE and COSTUMES. The SCRIPT BLOCKS are where the instructions of what your SPRITES can do! SCRIPTS AREA is where you put your instructions.
Script Bank, the Library
Guess which Library I am in
Which Library am I in?
Creating Simple Shapes
Creating Simple Shapes
What s wrong with this?
This didn t work either
One Possible Answer
Let s make this more interactive We are going to make a program that meets the following requirements: 1. You enter the number of sides in the shape and the length of each side 2. The computer calculates the angles required and draws the shape
Writing the algorithm In groups, using what you have learnt so far, try to work out how your program might run 1. What instructions would you need? 2. What order would they go in? 3. Would you need any new instructions that you haven t tried yet?
Creating a Shape Calculator How does a simple calculator work? 2 + 3 = 5 value a + value b = value c
Creating a calculator How does a simple calculator work? value a + value b = value c
Creating a calculator 2 3 5
Creating a calculator Variable in Scratch
What is a Variable?
Creating a calculator Creating the simple calculator using three variables. Questions What instruction block is used to start? Where is the block to ask a question? Where is the block to set the variable?
The Variables needed 1. Angle 2. Number of sides 3. Length of side
One Possible Solution
What else can we do? How could you adapt this program? What else could you do with the skills that you have learnt? Consider the following challenges to discuss in your groups: 1. Creating abstract art can you write a program where the art changes every time it is run? 2. Write a program to create the picture you drew this morning 3. Can you write a program that will draw a Pokémon character?
What else can we do? 1. Creating abstract art can you write a program where the art changes every time it is run? 2. Write a program to create the picture you drew this morning 3. Can you write a program that will draw a Pokémon character? Choose one of the challenges or design one of your own to create