Langkau ke kandungan

    Bug Garden

    Debugging Umur 6–8

    Track down bugs in longer robot programs by tracing each step.

    • Umur 6–8
    • 3 misi
    • Permulaan → Semakin mahir → Cabaran

    Year 2 debugging uses longer programs on bigger grids, so children need to trace carefully, one step at a time, to find where the robot goes wrong.

    Apa yang akan dipelajari anak anda

    • Trace programs of four to six steps
    • Find the step where a program goes wrong
    • Name the arrow that would fix it

    Trace, don’t guess

    The best debugging strategy is to follow the program exactly, step by step, and compare where the robot is with where it should be. The first place they differ is where the bug is.

    Contoh soalan

    Berikut ialah beberapa soalan seperti dalam misi pertama. Bolehkah anda menjawabnya?

    1. 1. The robot should reach the star, but one step has a bug. Which step is wrong?

      • Step 1
      • Step 2
      • Step 3
      • Step 4
      Tunjuk jawapan

      Jawapan: Step 1. Step 1 should be ↑ instead of ↓. Fix that one arrow and the robot reaches the star!

    2. 2. The robot should reach the star, but one step has a bug. Which step is wrong?

      • Step 1
      • Step 2
      • Step 3
      Tunjuk jawapan

      Jawapan: Step 2. Step 2 should be ← instead of ↑. Fix that one arrow and the robot reaches the star!

    3. 3. The robot should reach the star, but one step has a bug. Which step is wrong?

      • Step 1
      • Step 2
      • Step 3
      Tunjuk jawapan

      Jawapan: Step 2. Step 2 should be → instead of ↓. Fix that one arrow and the robot reaches the star!

    4. 4. Match each problem to its bug.

      • the robot goes the wrong way
      • the program stops too early
      • things happen in a strange order
      • a step is missing
      • a wrong direction
      • steps are swapped
      Tunjuk jawapan

      Jawapan: the program stops too early → a step is missing · the robot goes the wrong way → a wrong direction · things happen in a strange order → steps are swapped. Spotting the kind of bug helps you fix it.

    Tip untuk orang dewasa

    • Encourage finger-tracing on the screen for every step.
    • Praise careful checking more than speed.