UKUK USUSIndiaIndia
Progress you can see
Join Us
Lucy
Ask the AI Tutor
Need help with Code - How to Write Code 2? Ask our AI Tutor!
Lucy AI Tutor - Lucy
Connecting with Tutor...
Please wait while we establish connection
Lucy
Hi! I'm Lucy, your AI tutor. How can I help you with Code - How to Write Code 2 today?
now
Code - How to Write Code 2
Walking is easy for us but can you make a character on a computer screen walk?

Code - How to Write Code 2

Sometimes code does not work first time, and that is normal. In this quiz, you will spot what went wrong, choose better commands, and learn how to debug.

Explore the Topic →
(quiz starts below)

Fascinating Fact:

If something goes wrong, look for the step that caused it. Fixing mistakes in code is called debugging.

In KS1 Computing, children learn that a program follows instructions exactly, so a small mistake can change what happens. When you write code, you test it to see if it does what you expected. If it goes wrong, you check the steps one by one, find the part that caused the problem, and change the instruction, then test again to see if it works.

  • Debugging: Finding and fixing a mistake in code.
  • Instruction: A step that tells the computer what to do.
  • Predict: To guess what you think the program will do before you run it.
What does debugging mean in KS1?

Debugging in KS1 means finding the mistake in your code and fixing it so the program does what you wanted it to do.

How do you debug code step by step?

You debug step by step by running the program, watching where it goes wrong, checking each instruction in order, changing one part, and testing again.

Why does my code do something different to what I expected?

Your code may do something different because the instructions are in the wrong order, a command is missing, or the computer is following the words exactly in a way you did not mean.

1 .
Henry is stood up on two legs. Tom wants Henry to start walking with his left leg.

What code does Tom use?
Left Forward 1
Left Back 1
Right Forward 1
Right Back 1
Henry has put his left leg forward
2 .
The right leg now needs to move twice as far. Then it will be in front of the left leg.

What does Tom code?
Right Forward 1
Right Forward 2
Left Forward 1
Left Forward 2
Henry is now walking
3 .
Next, Henry needs to swing his left leg forwards. It must go in front of the right leg.

What does Tom code?
Left Forward 2
Left Back 2
Right Forward 2
Right Back 2
Henry is walking really well!
4 .
Now, Henry’s right leg needs to go in front of his left leg. Tom codes:
Stop
Run
Right Forward 2
Left Forward 2
There is a pattern - left, right, left, right
5 .
Tom wants Henry to keep walking forwards. Which one of these keeps Henry walking?
Left Forward 2 Right Back 2
Left Back 2 Right Back 2
Right Back 2 Left Back 2
Left Forward 2 Right Forward 2
Tom is pleased: Henry is walking
6 .
Tom can keep writing: Left Forward 2 Right Forward 2 again and again.

But there is a lot to write down. So, Tom gives these codes a name. He calls them Walk.

Now when Tom just writes Walk, what does Henry do?
Takes two steps forwards
Takes two steps backwards
Stops
Turns round
Now Tom can just type Walk and Henry takes two steps forwards
7 .
Tom wants Henry to move two steps forward and then stop. What should he code?
Walk Walk
Walk Run
Stop Walk
Walk Stop
Henry stands on the spot
8 .
Tom wants Henry to walk forward two steps, turn right, walk forward two more steps, then stop. What does Tom code?
Walk Walk Right Stop
Walk Right Stop Walk
Right Walk Walk Stop
Walk Right Walk Stop
Henry has gone round a corner
9 .
Tom now wants Henry to go forward two steps, turn left, walk forward two steps, then turn left again, and then stop.

What code does Tom use?
Walk Left Walk Right Stop
Walk Left Walk Left Stop
Left Walk Walk Left Stop
Walk Right Walk Right Stop
Tom is getting good at controlling Henry
10 .
Tom’s codes must be in the right _____.
Colour
Sound
Order
Size
Tom’s codes must be in the right order - they must be in the correct sequence
You can find more about this topic by visiting BBC Bitesize - What is a computer program?

Author:  David Bland (Former Physics Teacher, KS1 Science & Geography Quiz Writer)

© Copyright 2016-2026 - Education Quizzes
Work Innovate Ltd - Design | Development | Marketing