StudyBrixFree worksheets, study guides and courses

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.

Make a worksheet

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

  1. 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?

    1. 3
    2. 1
    3. 2
  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?

    1. 6
    2. 1
    3. 5
    4. 3
    5. 4
    6. 2

Answers and reasoning

Answers and marking notes
  1. 2

    Step 2 is ← instead of →.

  2. 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