lesson

Find the first wrong step

Read with an adult. You can say, point, draw or write your answer.

1 · Learn

A bug is a mistake in a program. Debugging means finding and fixing mistakes. Change a part for a reason, not just at random.

Compare what you expected with what happened. Follow the instructions one at a time and find the first place where they differ from your plan.

Goal: two squares forwardProgram: forward, forward, forwardExtra instruction: third forward
Key words and supplied examples.

2 · Worked example

The robot goes three squares instead of two. I remove the extra third forward, reset the start and test again.

3 · Your turn

A robot should move one square but has two forward commands. What change would you try?

Check your answer

Remove one forward command, reset the robot and run the remaining one to check.

4 · Apply your learning

Ask an adult to put one deliberate extra command in a short program. Explain the bug, fix it and test again.

Adult guidance and safety

Work with an adult in an approved offline or school-managed tool. Use pretend information, never real passwords or personal details. Paper activities model ideas but must be followed by suitable hands-on device practice.

Open your writing and drawing pad

Write, draw or show your working. Use a mouse, pen or finger. This pad is not a submitted answer.

Not saved to your account. Download your drawing as PNG and your typed notes as TXT before leaving or refreshing. They are separate files. Do not enter private information.

Open a picture saved on this device to draw on it again. Opening replaces the drawing, but Undo can restore it. PNG only, up to 4 MB and 4096 × 4096 pixels. The picture stays in this browser; it is not uploaded. Paper lines in a saved picture become part of that picture.

Drawing is unavailable. Use the typed working area below.

Your pad is empty.

Open a UTF-8 TXT file from this device, up to 40 KB and 10,000 characters. It stays in this browser. Opening can be undone until you type again. Downloads keep a new copy; they do not change the file you opened.

Typed notes are not submitted answers.

Practice this lesson

Lesson resources

Browse the available practice activities and worksheets for this lesson.

Open course resources

Your progress

Ready to continue?