Top-Down Design / Stepwise Refinement
| Step | What to do |
|---|---|
| 1 | Identify major components of the problem |
| 2 | Break each component into subcomponents |
| 3 | Continue refining until tasks are small enough to implement |
| 4 | Repeat/iterate (top-down design / stepwise refinement) |
Overall problem: Create an adventure game.
| Level | Component | Subcomponents/examples |
|---|---|---|
| 1 | Characters | Player, NPCs, enemies |
| 1 | Environments | Level design, backgrounds, interactive objects, collision |
| 1 | Game mechanics | Combat, scoring, quests, progression |
| 1 | User interface | Menus, HUD, inventory screen |
| 2 (Characters) | Player character | Appearance, stats, inventory |
| 2 (Characters) | NPCs | Dialogue, quest logic |
| 2 (Characters) | Enemies | AI behaviour, combat stats |
Structure Diagrams
The diagram is drawn as boxes joined by lines. The same breakdown is shown here as an outline, with each level indented under the task it belongs to.
Online quiz
+-- Load the questions
+-- Run the quiz
| +-- Ask a question
| +-- Check the answer
| +-- Update the score
+-- Show the results
+-- Calculate the percentage
+-- Display a message