Action sequences

Action Algorithms! - Lesson 5

Objectives

  • To know what an algorithm is
  • To write an algorithm for an action sequence
  • To understand that computers follow programming languages or ‘code’

Lesson Resources

Introduction

Recap what the children know about algorithms so far. What is an algorithm? What examples of algorithms have we looked at over the last few weeks? What does debugging mean? Can you give me an example of when you debugged an algorithm that you had made?

This lesson is all about creating code for action sequences. Show the children the 6 symbol tiles from the teacher presentation.

What could these symbols mean? Does it matter which way they face?

 

 

It’s a kind of sequence, where do you think it starts? Why? Where does it end? How many commands are part of this algorithm? How many algorithms are there?

Talk to a partner about what each tile could be telling us to do.

Discuss possible meanings for the symbols including the suggested code below or one you have made up yourself. Most of our actions are fairly logical (at least to us!) but they don’t have to be.

 

 

Follow the code with a few volunteer children. Could anyone just follow the actions for this code? Establish that they would need to understand the symbols (commands) before they could follow the code. Computers are the same, they work by following commands that have already been established in a coding language. This could be:

 

The buttons on a Beebot:

 

Blocks in Scratch:

 

Written coding languages like Python:

 

Change the code order:

 

Does this algorithm still work? Is it the same as the last algorithm? Why? What has changed? 

 

Does this algorithm still work? Is it the same as the last algorithm? Why? What has changed? 

This can happen with computers, sometimes this can break the code and stop it working, sometimes it’s fine and will still work, often key commands need to be in certain places but others can be moved around and the algorithm can still work.

Once we understand commands in a code though, we can interpret new code that uses the same commands. We recognise repetition of commands and sometimes variations of code we know.

What would this longer algorithm mean? (when using the same code as our example in the table above) Ask for someone to perform the actions of the code and ask the others to check the code as they do it. When they have finished ask do we need to debug anything they did?

 

Small group work

Put the pupils into groups of no more than 4. Give each group their own set of tiles and a symbols algorithms worksheet and ask them to discuss, and then assign an action of their own choice to each symbol. They should add it to their sheet . Swap with another pair and test their code. Did they do what you expected them to do?

 

Plenary

Ask a few pairs to perform their code to the class without explaining what it means. Can the class decode their code? Ask them what they think each symbol meant and add a sticky label to each tile. This is called ‘commenting out’ the code and is done by professional coders to make it clear to others how their code works or things for other coders to consider if they are going to use the code in the future.

< Previous Lesson

Next Lesson >