Year 7 › Scratch II: Subroutines and lists › Lesson 5 of 5
Year 7 · Summer 1 · Scratch II: Subroutines and lists Build and playtest the game
Topic 11 Algorithms
KS3 Computing · An algorithm is a precise, step-by-step plan to solve a problem. Computational thinking turns a messy problem into one. Every algorithm is built from just three things: sequence, selection and iteration.
Programming Computational Thinking Cambridge Lower Secondary Computing 0860
You will learn to Create a game from a flowchart, building and testing one part at a time. Use playtesting to find problems that another person can see. Fix at least two problems found by a tester, and test again.
Success criteria I can build my game in small steps and test each step. I can record what my tester found in a test table. I can fix two problems and show that they are fixed.
Algorithm Precise, ordered, finite steps to solve a problem.
Decomposition Breaking a problem into smaller ones.
Abstraction Ignoring detail that doesn't matter for the problem.
Sequence · selection · iteration Steps one after another. First this, then this.
Pseudocode Code-like writing for algorithms, without strict rules.
Trace table Records variable values step by step to check logic.
Variable A named place in memory that holds a value.
Build from your plan, one part at a time Your flowchart is the plan. Build one part of it at a time.
Pick the smallest part. For example: the player moves with the arrow keys. Build only that part. Click the green flag and test it. It works? Save, then build the next part. It does not work? Fix it now, before you add anything else. ★ RememberSmall steps, and test after each one. One new bug is easy to find. Ten new bugs at once are not.
e.g. ExampleSave a new copy after each part works: maze-v1, maze-v2, maze-v3. If something breaks badly, go back one version.
Playtesting: let someone try to break it Playtesting means someone else plays your game to find problems.
They have not seen your code. So they play in ways you did not expect.
Press two keys at once. Walk into every wall and every edge of the stage. Play twice. Does the score go back to 0? Lose on purpose. Does the game end? Do something silly: click the sprite, or hold a key down. ! Watch outTesters: watch and write it down. Do not take the mouse and fix it for them.
Record, choose, fix, test again Write each problem in a test table . It shows what you tested and what happened.
Fix the bugs that break the game first. Nice extras come last.
! Watch outAfter each fix, play the whole game again. A fix in one place can break something somewhere else.
e.g. Worked exampleYour tester says: 'When I play a second time, my score starts at 12.' How do you fix it?
Predict: the score should start at 0 in every game. Find: look under when green flag clicked. No block sets the score there. Fix: add set [score v] to (0) straight under when green flag clicked. Test: play twice. The score starts at 0 both times. Tick it off in the test table.
Mark this lesson as done Saved on this device.
← Previous lesson Design a game with a flowchart before coding End of unit → The end-of-unit challenge