ACARA Digital Technologies Years 7–8 — Tracing and Debugging Algorithms Hangman
Years 7–8 · Australian Curriculum · 57 key terms.
Every word, shuffled.
The names stay in this browser on this computer — they are never sent to Cloodit. A random student is called for each word.
Working out what an algorithm does, and finding where it goes wrong. See the whole journey →
Want your own words? Free Hangman Generator →
Same words, on paper
The quiet activity after the loud one. Free to print, answer keys included.
CrosswordAlgorithms, Flowcharts and Pseudocode and Tracing and Debugging Algorithms · Designing algorithms with branching and iteration · 7a Program Development Life Cycle · all 18
Word searchAlgorithms with Branching and Repetition · Algorithms, Flowcharts and Pseudocode to Programming with Control Structures and Functions (Python) · 7a Program Development Life Cycle · all 13
Worksheetfor any module, with answer key
When your class is on devices — Snake Break and Diamond Dash run on the same modules, with a free class.
The 57 key terms
- 1follow an algorithm
- To carry out each step exactly as written, in order, without skipping steps or guessing. You can track values on paper, check the final result, or act it out with a partner.
- 2dry run
- Working through an algorithm by hand, line by line, using chosen test data as inputs and recording each step in a trace table, to see what it does and find logic errors without running it.
- 3SET score TO 0
- A variable is a named place that stores a value. SET gives it a value, like 0, and later steps can change it, such as ADD 1 to score, so it works as a counter.
- 4ASK and SHOW
- ASK is an input step: it asks the user for a value and stores it in a variable. SHOW is an output step: it displays a result, like a message, on the screen.
- 5Trace table
- A table that records the value of each variable at every step of an algorithm, used to check its logic by hand.
- 6one column per variable
- To set up a trace table, give each variable its own column in the order they first appear, then add a row each time a value changes. Leave unchanged cells blank.
- 7Trace table INPUT
- A prompt is written in the OUTPUT column. The value the user types for an INPUT is written in that variable's column on that step, taken from the test data.
- 8OUTPUT column
- The trace table column where you write each value or message shown by an OUTPUT statement, on the row where it happens. Text in quotes is copied exactly as the output.
- 9Counter ← Counter + 1
- When tracing, work out the right side using the current values, then write the result in that variable's column. The old value is used first, then replaced by the new one.
- 10trace
- To trace an algorithm, pick starting values, follow each step in order, write down how the values change, and say what it shows at the end.
- 11IF condition THEN action1 ELSE action2
- Chooses between two paths. If the condition is true, action1 runs. If it is false, the ELSE path runs action2 instead. Exactly one of the two paths runs.
- 12AND / OR
- AND is true only when both conditions are true. OR is true when at least one is true. Saturday AND sunny needs both; Saturday OR sunny needs just one.
- 13IF Mark >= 50 THEN
- To trace an IF, work out if the condition is TRUE or FALSE for the current values, then follow only the THEN or ELSE path. Skipped statements get no row in the trace table.
- 14condition column
- A trace table column headed by a condition, such as age >= 13, that records TRUE or FALSE on each row so you can see which path the algorithm took and why.
- 15nested if
- An if block written inside another if block. The inner condition is only checked when the outer condition is true. Indent the inner block and give each if its own end if.
- 16trace an if
- Check the condition using the current values, record TRUE or FALSE in the trace table, then follow only the branch that is true and skip the other branch.
- 17REPEAT n TIMES
- Runs the indented steps under it exactly n times, then moves on to the next step. Use END REPEAT to show where the loop stops. Example: REPEAT 5 TIMES.
- 18REPEAT ... UNTIL
- A loop that keeps repeating its steps until a condition becomes true. Use it when you don't know how many times. Make sure the condition can happen, or the loop never stops.
- 19WHILE and REPEAT loop trace
- Trace a loop by testing its condition each pass: WHILE tests before the body and may never run; REPEAT tests after the body so runs once at least. Stop when the loop ends.
- 20SET count TO 0
- Makes a counter. Set count to 0 before the loop, ADD 1 TO count inside the loop each time it repeats, then SHOW count after the loop.
- 21IF card = red THEN count ← count + 1
- Inside a loop, the IF checks each item. Only when the item meets the condition does the counter go up by 1. If the condition is false, the counter stays the same.
- 22Count ← Count + 1
- Trace table for counting and totalling: Count and Total start at 0 in the first row, change each pass (Count only if the IF is true), and the final values are output after the loop.
- 23Average <- Total / Count
- After the loop ends, divide the total by the count to get the mean. Check that Count > 0 first, so the program never divides by zero.
- 24IF inside REPEAT
- An IF placed inside a REPEAT is checked again on every repetition, so each pass through the loop can take a different path.
- 25one row per pass
- Trace an IF inside a loop with one row for each pass, showing the condition result (true or false) and any variables that change. The final row gives the output.
- 26if x > 0 then for i from 1 to x
- A loop written inside an if branch only runs when that branch's condition is true. If the condition is false, the loop is skipped. An else branch can hold a loop too.
- 27Mixed iteration
- Nesting one loop type inside a different loop type, such as a FOR loop inside a WHILE loop
- 28nested loop
- A loop inside another loop. When tracing, the inner loop completes all its repeats for each single repeat of the outer loop, so total passes = outer repeats x inner repeats.
- 29Execution order
- The exact sequence in which an algorithm's lines run, followed step by step to trace its behaviour.
- 31purpose
- What the whole algorithm achieves. Follow the steps, check what it SHOWS and read the variable names for clues, then say it in one sentence.
- 32flowchart
- A diagram that uses an oval for start and end, a rectangle for a step and a diamond for a yes or no question, all joined by arrows that show the order.
- 33decision diamond
- A diamond shape in a flowchart that asks a yes or no question. One arrow is labelled Yes and one is labelled No, and each arrow leads to different steps.
- 34loop arrow
- An arrow that goes back to an earlier shape so steps repeat. The loop stops when the decision's exit arrow is followed, such as when the answer is Yes.
- 35age >= 13 AND has_permission = Yes
- A combined condition in one decision diamond. AND needs both parts true, OR needs just one, NOT reverses it. One diamond with AND matches two diamonds in a row.
- 36trace a flowchart
- Start at the oval, follow each arrow with your finger, answer every diamond using the current values, write down counter changes, and stop at the end oval to find the result.
- 37prediction table
- A table listing each flowchart shape you visit in order, the Yes or No answer at each diamond, the variable values after each step, and any output.
- 38loop-back arrow
- An arrow that returns to a decision diamond. Each time you follow it, add a new row to the trace table so every pass of the loop is recorded, until you take the exit arrow.
- 39flowchart to steps
- Changing a flowchart into written steps: a diamond becomes IF or a loop condition, a back arrow becomes REPEAT, then check both versions do the same thing.
- 40REPEAT UNTIL guess = secret
- The guessing game loop: keep asking for a guess until it matches the secret number. Inside, decide too high, too low or correct, and add 1 to the count each time.
- 41test case
- A chosen input paired with the output you expect. Run the algorithm, record the actual output, then compare: if actual matches expected it passes, otherwise it fails.
- 43Boundary values
- Test inputs at the edge of a condition. For age >= 18, test 17 (just below), 18 (exactly on) and 19 (just above) to check the algorithm picks the right path at the edge.
- 44error in an algorithm
- A mistake that breaks pseudocode rules or gives wrong results. Find it by reading the code, then trace it with test values and compare the actual output with the expected output.
- 45logic error
- A mistake in an algorithm's steps. It still runs to the end with no warning, but gives the wrong output. Only tracing or testing shows it, unlike a syntax error that breaks the writing rules.
- 46first wrong value
- In a trace table, the first row where a value differs from what you expected points to the faulty line of the algorithm. Look at that line, then suggest a correction.
- 47sequence
- Steps that run one after another in a set order. Changing the order, leaving a step out or adding an extra step can change the result.
- 48Total ← 0
- Set a total or counter to 0 before the loop. If you forget, it starts from an unknown value; if you put it inside the loop, it resets every time.
- 49Age >= 18
- Using > instead of >= (or < instead of <=) is a logic error: the boundary value, such as Age 18, is wrongly rejected. Test the boundary value, then correct the operator.
- 50Mark < 0 OR Mark > 100
- Use OR, not AND, to catch an invalid mark. A mark cannot be below 0 and above 100 at once, so AND is never TRUE. OR is TRUE when either part is TRUE.
- 51infinite loop
- A loop that never stops because its stopping condition can never become true. Something inside the loop, like a counter, must change to work towards the condition.
- 52off-by-one error
- A bug where a repeat count or stop test is wrong by one, such as count > 5 instead of count = 5, so the loop body runs one time too many or one time too few.
- 53swapped branches
- The THEN and ELSE paths are the wrong way round, so the algorithm gives the opposite result for every input. Fix it by swapping the two paths or by flipping the condition.
- 54loop placement error
- A bug where a step sits in the wrong place around a loop. A SHOW inside repeats every pass, and an update outside runs only once. Indentation shows which steps are inside the loop.
- 55flowchart error
- A mistake in a flowchart, such as the wrong symbol shape, a missing Yes or No label, a path that never reaches Stop, or a loop arrow joining the wrong place.
- 56Line 3 should be Total ← 0
- To suggest a correction, name the wrong line or symbol, say why it is wrong, write the corrected statement, and explain what the fix changes in the algorithm's output.
- 57amend an algorithm
- Find the part that must change for the new requirement, change only that part, then re-trace the algorithm to check the rest still works.
- 58re-trace
- After a fix, trace the algorithm again with the same failing input, then other inputs, to check the output now matches what was expected.
- 59bug report
- A short note giving the input used, the expected and actual output, the trace row where it goes wrong, the cause and the correction. Use 'because' to explain the cause to a classmate.
Frequently Asked Questions
Do I need an account?
No. Hangman runs straight from this page — no account, no sign-up, nothing to install. If you add your class names, they are saved in your own browser and never sent to Cloodit.
How do I play it with my class?
Put the page on your whiteboard or projector and press Play. The class calls out letters and you click or type them. Six wrong letters and the word gets away. After every word its definition appears, so each round ends on the meaning, not just the spelling.
Can I use my own words?
Yes. The free Hangman generator at cloodit.com/hangman/ takes any list: one word or phrase per line, with a definition after a dash if you want it shown at the end of the round.
Can I put my students' names in?
Yes. Add your class list and a random student is called for each word. The list stays in this browser on this computer, so it is still there next lesson.
Are the worksheets free too?
Yes. Every module in this journey has a free printable worksheet with a full answer key, and there are crosswords and word searches built from the same key terms.