Computer science · Grades 1–3
Find the bug
Study guide for Grades 1 to 3: 2 worked examples and 2 practice questions. Debugging means checking each step against the plan to find the one that is wrong.
Rule and key idea
Debugging means checking each step against the plan to find the one that is wrong.
bug = a step that does not match the plan
Worked examples
A robot must move 4 squares to the right to reach a star, so every step should be →. Its program is: ↓ → → →. Which step number is the bug?
Step 1 is ↓ instead of →.
1
A robot must move 4 squares to the right to reach a star, so every step should be →. Its program is: → → → ↑. Which step number is the bug?
Step 4 is ↑ instead of →.
4
Try two questions
A robot must move 3 squares to the right to reach a star, so every step should be →. Its program is: → ← →. Which step number is the bug?
- 3
- 1
- 2
A robot must move 6 squares to the right to reach a star, so every step should be →. Its program is: → → ← → → →. Which step number is the bug?
- 6
- 1
- 5
- 3
- 4
- 2
Answers and reasoning
Answers and marking notes
- 2
Step 2 is ← instead of →.
- 3
Step 3 is ← instead of →.
How this page was made: written for StudyBrix with AI assistance from our own templates. Answers and worked examples are checked by automated tests, and grade bands are approximate, not an official curriculum alignment. See the editorial policy for corrections. Editorial policy