Supporting children in understanding what algorithms are, how they are implemented into programs and how programs execute them
Activity idea: What code causes the dragon to flap his wings?
This is a simple activity that requires children to find the code that causes the dragon to flap its wings. Children can be provided with the dragon sprites code (Fig 2.1).
This activity requires children to use decomposition, where they need to break down the problem into smaller, manageable pieces. Not only this, but they would also need to use abstraction in order to find the specific code that they are looking for, therefore they would be able to get rid of the unnecessary code that does not appear to have anything to do with the dragon flapping its wings. Exploring this piece of code will support children in understanding how algorithms need to be written and how programs are implemented on digital devices in order to achieve specific outcomes.
This activity will support children in developing a strong understanding of Scratch programming language and how it uses different blocks such as ‘if’ and ‘when green flag is clicked’ to carry out algorithms. It will also familiarise children with how programming languages use different codes to complete different tasks.
Although this game supports children in understanding Scratch, it will also support them in developing an understanding of the micro:bit and what code is required to trigger the micro:bit to react within the game situation. This is demonstrating how children can develop their understanding of programs that control physical systems.
Could this activity be extended?
This activity starts out very simple, however, you could encourage children to abstract the code after they have identified the part that makes the dragon change costume in order to flap. As you can see in fig 2.1, pressing button A causes five different costume changes, but children could manipulate this code, where they take out four of these and replace them with a ‘next costume’ block, as demonstrated in fig 2.2. This supports children in using logical reasoning, where they will be required to predict what will happen if they manipulate the algorithm.