Problem Solving and Modelling
4.1
Activity 1
The Boolean Bot
Just as in previous years, we start with some paper based problem solving. Pupils write instructions for a 'robot detective' to find the right key to open a safe. This activity builds on the Year 3 and 4 Robot activities, so make sure your pupils have been taught those first before they attempt this one.
Prepare:
- Create a video or image of a robot detective for the pupils to help. This robot detective can take many forms, depending on your preference:
- A Yakit Kids or Tellagami talking video explaining his problem.
- A life size drawing on your display wall.
- A special hat that you can place on any pupil to turn him/her into the robot detective.
- Find A3 paper!
- Fill some example flow charts that have a Boolean question, i.e. a Yes/No question where the code diverges depending on the answer (see examples in the image opposite).
- Get hold of a padlock (with key) and a range of other keys.
Activity Tasks:
- Introduce your robot detecitive to the class. Explain that we are trying to code a robot that can test out each key until it finds the correct one to open the padlock.
- Draw a simple flowchart code with a back-to-start loop (Pick up key -> try in padlock ->put down key -> Back to start). What's wrong with this code? Hopefully a pupil will note that if the first key is correct, the robot will continue to try the other keys, wasting time.
- Show them the example codes to introduce the idea of a Boolean question.
- Remind them that flowcharts have simple language and clear instructions that take us from one step to the next.
- Point to the few lines of code before the Boolean element (i.e. the things that only happen at the start) and after the Boolean element (things that only happen right at the end)
- Hand out A3 sheets and have the pupils create a flow chart to write their code for opening the padlock. The more concise the better. More able pupils can be encouraged to limit themselves to 3 words per instruction.
- Have one child act as the robot to 'test out' the codes, with pupils reading their codes step by step to him.
- Ask them to write the code again, but this time imagining there are three padlocks to be opened (still with 5-10 possible keys). Hopefully they will keep their original code but now add a loop so that the actions repeat for padlock 2 and 3.
Remember
- Flow chart instructions should be kept simple and should be easily followed without the need for context.
- There is no need for full grammatical sentences in their flow charts. Coding requires simplicity and clarity.
Activity 2
Debug my Sprite
An important skill at this level is debugging errors in software. This skill has been mentioned often in earlier years, and should be revisited as often as possible. In this example the pupils are given a set of codes for a race between a pig, dog and snail. They must find the errors in the code, correct them and then create their own race.
Prepare:
- Download a simple coding app that gives you freedom to code as you like (Scratch Jr is highly recommended).
- Familiarise yourself with the app before introducing it to your class. Have a go at the Race activity available on the Scratch Jr website (click here).
- Copy the code for the race activity, but amend a few bits so that your new code has errors (e.g. make the dog move 10 steps instead of 15, make the pig go fast)
Scratch Jr Race Instructions - from www.scratchjr.org
Activity Tasks:
- Show an image of the race to the pupils, and then your error strewn codes. Explain that the code creates the race in Scratch Kr, with the dog winning, the rabbit second and the pig last. Tell them to correct any errors they encounter when copying the code.
- Pupils use the codes to create the race, exactly as it was on the original activity card (correcting the errors as and when they spot them).
- Now ask the pupils to create another race, this time between three objects moving vertically from the bottom of the screen to the top.
- For an extension, ask the pupils to add code to the winner, showing how they celebrated their win, and to the loser showing how upset they are.
Remember
- Pupils will not be ready for this activity unless they've had the Coding experiences in previous years. In the first few years of implementing the Framework, do check this and consider doing activities from previous years first.
- If you want other codes to use as further practise, go to the Scratch Jr website and amend any of the codes on their Teach page: Click here to see their examples
Activity 3
Costume Change
Your pupils will have some experience of a full coding environment from their Year 4 work with the colour changing cat. They will now extend their skills by creating a room full of items that change depending on what you type.
Prepare:
- Create an account and familiarise yourself with a visual Coding software. Scratch is highly recommended and free online. (Another option is J2Code which is part of J2E)
- Practise the activity your pupils will be doing by following the step by step instructions yourself.
Guide to Scratch Costume Changes
Activity Tasks
- Remind pupils how to build simple code in Scratch (See Year 4 Chameleon Cat Coding activity)
- Show them your model Costume Change, pointing out the simple code that makes it happen.
- Ask your pupils to log into Scratch, start a new activity and add three characters.
- Show how to create a second costume for the characters, turning them into superheroes.
- Explain how broadcasting works in Coding (see the video above).
- Give the pupils the basic codes in the link above, and model how to use them to make the game ask a question and then to change a character's costume depending on the answer.
- Pupils can now create their own superhero changing game, adding a background at the end.
Remember
- If you have very confident coders in your class, give them an extension activity by asking them to think of other ways of using costume changes in a code (e.g. a witch turning people into animals).