One of the amazing things about technology is in the way in which it can enable all of us to become makers and creators. We can learn a tool and then apply our own artistic and creative understanding to produce different outcomes from it. We can even make our own tools for expression.
This week the pupils in Year 5 and Year 6 have been programming their own drawing machines using Scratch.
Last week we looked at how programming is much like reading a list of instructions and making sure we apply those instructions in the correct order. Using our (if this, do that) method of understanding, we could build up a series of instructions to perform a program.
Computers are not as clever as us humans and so we need to give them exact instructions or they will not do as we ask. We can also figure out ways of getting them to perform lots of tasks with as little effort from us as possible.
We must remember that there can often be many different ways to solve the same problem in programming.
Last week we also explored variables – values that are stored on the computer and can change either via instructions from the program or from user interaction, such as pressing a key on the keyboard.
We looked at 2 types of variables: strings which are characters, letters or words and integers which are whole numbers.
Our integer variables this week were the co ordinates of the character on the screen, called ‘x’ and ‘y’. By changing the numbers we could manipulate the character and make it move. Using our (if this, do that) structure we could create a keyboard press IF and a variable change THAT to produce the movement. We had to press the key a lot of times to make our character move about !
To create instructions that repeat themselves over and over again we learned about ‘Recursion’ or Looping/Repeating. This enables us to take a few instructions and repeat them many times without having to keep sending the same instructions again and again.
Making our character move with one instruction was really fun. Making him move 20 steps in one direction involved a lot of key presses; imagine that it needed to move 1000 steps….
By taking an instruction and repeating it we could have one key press perform many actions for us!
Learning repetition is much more fun when we can use it to draw shapes for us on screen.
Understanding how to repeat a simple instruction such as move forward and turn right 90 degrees we could build up repetitions to allow us to instruct the computer to move in a square shape and draw it out for us. (Hint: we repeated the instruction 4 times)
Using Scratch, we were able to take simple instructions and repeat them to create our own creative drawing tool. Using the Pen commands we created a spirograph/etch-a-sketch tool that responded to our inputs from the keyboard.
By changing the variables we could create different shapes and colours. By adding in the ability to stamp our character sprite on the screen we could create colourful spiral drawings made of ghosts, unicorns and cats.