Blame
|
1 | <!-- Generated from applied-computing-au vic/unit3-4/sat/C08-2026/C08-Reference-Godot by port-reference-godot-to-wiki.py — do not hand-edit; re-run the port. --> |
||||||
| 2 | # Debugging with Tetris — three practice bugs |
|||||||
| 3 | ||||||||
| 4 | *Practise the C8-1 skills on a real Godot game before you use them on your own SAT project. Each exercise is a git branch with a seeded fault and a brief; the tools are covered in [Godot Debugging Tools](/sd/C08/Godot%20Debugging%20Tools) and [Debugging with Breakpoints in Godot](/sd/C08/Debugging%20with%20Breakpoints%20in%20Godot).* |
|||||||
| 5 | ||||||||
| 6 | ## Setup (once) |
|||||||
| 7 | ||||||||
| 8 | ``` |
|||||||
| 9 | git clone https://github.com/jeremy-oz/godot-tetris |
|||||||
| 10 | ``` |
|||||||
| 11 | ||||||||
| 12 | Open the folder in **Godot 4.7**. Controls: arrows move, **Z / X** rotate, **Down** soft drop, **Space** hard drop, **C** hold. |
|||||||
| 13 | ||||||||
| 14 | For each exercise: `git checkout <branch>`, then read **`C8-DEBUG-EXERCISE.md`** at the repo root — the brief changes with the branch. |
|||||||
| 15 | ||||||||
| 16 | ## The three exercises |
|||||||
| 17 | ||||||||
| 18 | | Branch | The story | Skill you practise | Rubric | |
|||||||
| 19 | |---|---|---|---| |
|||||||
| 20 | | `c8-debug-statements` | The score creeps up on its own — which line adds the phantom points? | **Debugging statements** — `print_debug` at each suspect site, read the Output panel | 3–4 | |
|||||||
| 21 | | `c8-debug-breakpoint` | The new Perfect Clear bonus never pays. | **Breakpoints** — pause the decision, Step Into, read the Locals panel | 5–6 | |
|||||||
| 22 | | `c8-debug-rectify` | The new IP validation lets rubbish through. | **The full cycle** — run a testing table, debug the failing rows, rectify, re-run, document corrective actions | 5–10 | |
|||||||
| 23 | ||||||||
| 24 | Do them in order — each exercise assumes the tool from the one before. |
|||||||
| 25 | ||||||||
| 26 | ## The loop these exercises teach |
|||||||
| 27 | ||||||||
| 28 | Your [testing table](/sd/C08/Testing%20Tables%20and%20Corrections) and the debugger are one workflow, not two documents: |
|||||||
| 29 | ||||||||
| 30 | **the table finds the failure → the debugger locates the fault → the Corrective Action column records what the debugger showed you → the re-run turns the row green.** |
|||||||
| 31 | ||||||||
| 32 | Exercise 3 ends with a **narrated practice recording** of that loop — the same unbroken fix cycle your real C8-1 screen recording must show. |
|||||||
| 33 | ||||||||
| 34 | > **Practice is not evidence.** Your C8-1 recording must show your **own SAT project** — your git log, your testing table, your code. A tetris recording earns exactly zero rubric levels; it just makes the real one easy. |
|||||||
| 35 | ||||||||
| 36 | When a branch has beaten you (that's allowed): `git diff main` shows the seeded change. Look only after you've genuinely tried the tool — the diff answers *where*, but the exercise was *how to find where*. |
|||||||
