Direction Sequences
Objectives
- Understand what an algorithm is
- Give precise and unambiguous instructions
- Create and debug simple programs
Resources
What is an algorithm?
Start in the classroom. Does anyone know what an algorithm is? It’s a series of instructions, what does that mean if we give an instruction? What makes a good or bad instruction?
Has anyone ever had to give directions to someone? We might give different kinds of instructions depending on the type of directions we are giving. e.g:
- Do you know where the glue is?
- How do I get to Whitley Bay?
- Where is the ICT room?
Directing a person -
What kind of words could we use if we were going to direct a blindfolded person to help them move safely?
- Forward
- Backwards
- Left
- Right
- Side step
- Number of steps
- Turn
Choose a couple of volunteers to be blindfolded and ask the class to guide them out of a ‘minefield’ of cones/markers/crocodiles without touching them. Focus on the instructions they give, the language they use and are they clear and easy to understand. Ensure the blindfolded people only do what they have been told and don’t interpret the instructions. Note their instructions down on a board or the whiteboard as they give them to capture the algorithm they create for moving through the ‘minefield’.
Once they have successfully guided the volunteer through the field, look back at the algorithm you recorded on the board. Can we improve this in any way? Can we shorten the number of instructions we used? (often they will have repeated instructions in a sequence that can be shortened into one, e.g. Fd 4, Fd 3, Fd 1 could be shortened into Fd 8) Did we make any mistakes that we can debug?
When we give instructions to a computer or machine we call it programming. This can be done in different ways to make things happen on the machine or computer. Machines only understand certain languages, just like we do. Some computer languages have to be written very carefully as computers can’t think for themselves, they just follow the algorithms (like our blindfolded helpers).
Open 2Go and look at getting from A to B with the map background (click on the paper in the top left and choose your background). Ask the children to work with a partner. Partner A chooses a start and end point for the car journey. Partner B tries to guide the car successfully from start to end point without crashing or driving on the grass. Swap over and repeat.
Was it easy or difficult? What’s the hardest part - when to turn? judging the distances? Did anyone think about more than one step at a time?
Then turn on the programming feature (you will need to do this on each computer by pressing Ctrl + Shift + O for the teacher options, and ticking the ‘allow programming’ box) and ask them to try plotting the whole sequence before beginning - they can help each other to try this. De-bug any mistakes (discuss this term) until the sequence is correct.
Review again at the end:
Was it easy or difficult? What’s the hardest part - when to turn? judging the distances? Was it hard to think about more than one step at a time?