Skip to main content

Let’s Talk Science and the Royal Society of Canada have partnered to provide Globe and Mail readers with relevant coverage about issues that affect us all – from education to the impact of leading-edge scientific discoveries. Let’s Talk Science offers a number of fun activities to get youth engaged in STEM.

Create a code to travel from the start square to the end square of a graph paper or draw a picture.

What You Need

· Graph paper

· Writing tool

· Reproducible: Programming sheet

What to Do

1. Choose one partner to start as the programmer.

2. The programmer creates a list of actions (a code) on the programming sheet, using arrows to represent moving one square in the direction indicated by the arrow.

3. The programmer will make a code that directs their partner to draw a line through the squares that will connect the starting square to the end square. Draw dots in some of the squares. The line must go through a required number of dots before reaching the end square. See the photo for an example.

4. For an added challenge, students can create code that directs their partner to fill in the squares to create a picture. Use a squiggle symbol in your code to indicate that the square should be filled in. See the photo for an example.

What’s happening?

By giving your partner a series of commands, you are creating an algorithm. An algorithm is a series of ordered and logical instructions needed to complete a task. During the activity, you may have given instructions that did not work the way you expected. These errors are called ‘bugs’ in the computer coding world. When you adjusted your instructions to correct the error you were debugging. Debugging is when you find and correct bugs. Bugs in a computer program could be due to syntax errors (e.g. spelling mistakes) or logic errors.

Why does it matter?

As technology advances, it is more important than ever that you are prepared to contribute to the digital world. Building your computational thinking skills, such as algorithmic thinking, debugging, and pattern recognition, and strengthening your understanding of computational thinking concepts, such as sequences and repetition, will help you to prepare for the future.

You may have noticed patterns in your commands. These patterns can help you figure out what might happen as well as show you when those actions need to be repeated multiple times. It can help you solve new problems more quickly by applying the patterns you learned to something different. The commands you gave followed a sequence. A sequence can have repeated tasks or tasks that only happen in particular situations. Flowcharts can be used to help understand sequences. Your partner may have had to repeat certain instructions a number of times. This kind of repetition happens a lot in computer programming. Instead of writing out that step multiple times, it can be set up so that it automatically repeats or loops a certain number of times.

Investigate further

· Add obstacles on the graph paper that the drawer will have to avoid

· Watch this video to learn more about debugging

Discover more free, English and French, Let’s Talk Science hands-on STEM activities, resources and events online.

Follow related authors and topics

Authors and topics you follow will be added to your personal news feed in Following.

Interact with The Globe