GRADE 8 · COMPUTING · UNIT 1 · LESSON 1.54

Computational thinking and programming

Project 2: Fire, Water, Earth

Read a little. Try the workbook. Check your answers. Choose one section below to get started.

12 fillable worksheet pagesRead at your own pace

LET’S TRACE, REASON AND TEST

Project 2: Fire, Water, Earth

Original companion preparation, project or review

A two-device game needs rules for one complete round before optional scoring. Agree message codes, when choices are revealed and how outcomes are decided. Paper outcomes do not certify radio timing or reliability.

Today’s two goals
  • Specify consistent game rules and a complete outcome table.
  • Design input, transmission and comparison behaviour for each device.
Original PaxaKids illustration for Project 2: Fire, Water, Earth. Use the supplied program and data models for precise workbook facts.
An original PaxaKids workbook scene. Use the supplied programs and data for precise workbook facts.

Work through an example

For a three-choice cyclic game, a complete one-round table has nine ordered pairs: three draws and six non-draw cases. State the winner for every pair before adding a running score.

Try before your workbook

Why should a one-round design test matching choices as well as different choices?

Explore the clues

Tap one card to find out more.

Understand the idea

A two-device game needs rules for one complete round before optional scoring. Agree message codes, when choices are revealed and how outcomes are decided. Paper outcomes do not certify radio timing or reliability.

Concept to practise: Project 2: Fire, Water, Earth.

Work through an example

For a three-choice cyclic game, a complete one-round table has nine ordered pairs: three draws and six non-draw cases. State the winner for every pair before adding a running score.

Try before your workbook

Why should a one-round design test matching choices as well as different choices?

Check my readiness thinking

Matching choices check the draw rule and reset behaviour. A complete outcome table must cover all allowed pairs, not only winning cases.

Your original programs and learning models

These original PaxaKids program and data models support your workbook. Some examples deliberately contain faults to investigate. Follow their headings and preserve exact code case, punctuation and order. Traces and supplied records are not claims of physical testing.

Design a two-device Fire, Water, Earth game

Each player chooses fire, water or earth using a separate micro:bit. Fire beats earth; earth beats water; water beats fire. Equal choices draw. Each device must know both choices before deciding its own result.

Agree rules, inputs, messages, outputs and a reset procedure. Use this complete original starter or design an equivalent. Add the optional win counter only after a complete round works.

Complete every outcome from one device’s viewpoint

Rows are this device’s own choice; columns are the other player’s choice. Write Win, Lose or Draw in every cell using the stated rules. This complete table plans all nine combinations before practical testing.
Complete every outcome from one device’s viewpoint — original model
Mine / TheirsFireWaterEarth
Fire{'clue': 'Win / Lose / Draw', 'prompt': 'Fire against Fire', 'answers': ['Draw']}{'clue': 'Win / Lose / Draw', 'prompt': 'Fire against Water', 'answers': ['Lose']}{'clue': 'Win / Lose / Draw', 'prompt': 'Fire against Earth', 'answers': ['Win']}
Water{'clue': 'Win / Lose / Draw', 'prompt': 'Water against Fire', 'answers': ['Win']}{'clue': 'Win / Lose / Draw', 'prompt': 'Water against Water', 'answers': ['Draw']}{'clue': 'Win / Lose / Draw', 'prompt': 'Water against Earth', 'answers': ['Lose']}
Earth{'clue': 'Win / Lose / Draw', 'prompt': 'Earth against Fire', 'answers': ['Lose']}{'clue': 'Win / Lose / Draw', 'prompt': 'Earth against Water', 'answers': ['Win']}{'clue': 'Win / Lose / Draw', 'prompt': 'Earth against Earth', 'answers': ['Draw']}

Specify inputs and numeric message meanings

Use A for fire (choice 1), B for water (choice 2), and Shake for earth (choice 3). The numeric payload is round * 10 + choice. In round 1 the valid payloads are 11, 12 and 13; in round 2 they are 21, 22 and 23. Both devices explicitly use radio group 27.
Specify inputs and numeric message meanings — original model
Input / choiceRound 1 payloadRound 2 payload
A / fire{'clue': 'Number sent', 'prompt': 'Round1 A / fire', 'answers': ['11']}{'clue': 'Number sent', 'prompt': 'Round2 A / fire', 'answers': ['21']}
B / water{'clue': 'Number sent', 'prompt': 'Round1 B / water', 'answers': ['12']}{'clue': 'Number sent', 'prompt': 'Round2 B / water', 'answers': ['22']}
Shake / earth{'clue': 'Number sent', 'prompt': 'Round1 Shake / earth', 'answers': ['13']}{'clue': 'Number sent', 'prompt': 'Round2 Shake / earth', 'answers': ['23']}

Complete program, part 1: state and result decision

Put parts 1–3 together in order as one MakeCode JavaScript program, then use the same complete program on both intended devices. The state values 0 mean not chosen/not received. shown prevents a completed result being counted or displayed again.
Original Paxa core, part 1 of 3
let round = 1
let mine = 0
let theirs = 0
let shown = false
radio.setGroup(27)
basic.showString("R" + round)
function finishRound() {
    if (mine != 0 && theirs != 0 && !shown) {
        shown = true
        if (mine == theirs) {
            basic.showString("DRAW")
        } else if ((mine == 1 && theirs == 3)
            || (mine == 2 && theirs == 1)
            || (mine == 3 && theirs == 2)) {
            basic.showString("WIN")
        } else {
            basic.showString("LOSE")
        }
    }
}

Complete program, part 2: sending and receiving

Append this part directly after part 1. The MakeCode function guide requires the parameter type: value: number means the choose function accepts a number. It locks the first local choice. The receive handler accepts only the first recognised choice for the current round.
Original Paxa core, part 2 of 3
function choose(value: number) {
    if (mine == 0 && !shown) {
        mine = value
        radio.sendNumber(round * 10 + mine)
        finishRound()
    }
}
radio.onReceivedNumber(function (receivedNumber) {
    if (theirs == 0 && !shown) {
        if (receivedNumber == round * 10 + 1) {
            theirs = 1
        } else if (receivedNumber == round * 10 + 2) {
            theirs = 2
        } else if (receivedNumber == round * 10 + 3) {
            theirs = 3
        }
        finishRound()
    }
})

Complete program, part 3: inputs and new round

Append this final part after part 2. A and B select choices; Shake selects earth. After both players read their result, press A+B together once on each device to advance and reset before any new choice. Check that both show the same round label, such as R2.
Original Paxa core, part 3 of 3
input.onButtonPressed(Button.A, function () { choose(1) })
input.onButtonPressed(Button.B, function () { choose(2) })
input.onGesture(Gesture.Shake, function () { choose(3) })
input.onButtonPressed(Button.AB, function () {
    round += 1
    mine = 0
    theirs = 0
    shown = false
    basic.showString("R" + round)
})

Trace a received-first round and duplicate protection

Start a fresh core run: round 1, mine 0, theirs 0, shown false. Follow these events in order on one device. Write WIN or None for a new display call. None means this event adds no display output; the startup R1 display may remain.
Trace a received-first round and duplicate protection — original model
Event in orderNew display call
Receive 13 before local choice{'clue': 'WIN or None', 'prompt': 'Received-first step1', 'answers': ['None']}
Press A: choose fire, send 11{'clue': 'WIN or None', 'prompt': 'Received-first step2', 'answers': ['WIN']}
Receive duplicate 13 after result{'clue': 'WIN or None', 'prompt': 'Received-first step3', 'answers': ['None']}
Press B after local choice is locked{'clue': 'WIN or None', 'prompt': 'Received-first step4', 'answers': ['None']}

Reset per-round state and reject stale messages

After both have finished reading a round, each player advances once with A+B. The new-round sequence below clears only per-round state. The receive conditions then require the new round’s payloads. If round labels disagree, stop and coordinate the setup before choosing.
  1. Increase round by 1
  2. Set mine to 0
  3. Set theirs to 0
  4. Set shown to false
  5. Display the new round label

Plan real tests for both directions and orderings

Test all nine choice combinations, both result viewpoints, incoming data before and after the local choice, repeated input, duplicate or unknown data and a coordinated new round. Keep expected and actual output separate.

A paper model checks the rules and algorithm. Actual supported-environment or device observations are needed for a practical claim; otherwise record Pending. Save each program version and describe the actual contribution of each person or your individual work.

Optional extension: count wins after a complete round works

Once the core is working, add these three precisely located changes. Inside the WIN branch, keep the same indentation as its old display line. At startup wins begins at 0. Increase it only inside a newly completed WIN branch. The A+B handler keeps the total and displays it after the new round label; restarting the program resets it.
Original Paxa optional win-counter changes
// After the startup declaration let shown = false:
let wins = 0

// Replace the WIN branch display line with these two:
wins += 1
basic.showString("WIN")

// At the END of the A+B handler, after its round display:
basic.showString("W" + wins)

Files for this activity

Use these original PaxaKids practice files with the matching workbook. Work on a local copy in the appropriate editor. Some examples deliberately contain faults to investigate; a downloaded file is not a completed practical test.

Paxa the Fox

Try one step with Paxa!

Trace code in the stated order and preserve exact spelling and case. Use fictional data. Label a prediction, paper trace, simulator run and physical-device test separately; an unperformed test stays Pending. Save personal responses before leaving.

Our Unit 1 learning path
  1. Lesson 1.1: Recall algorithms and representations
  2. Lesson 1.2: Purpose and conventions of pseudocode
  3. Lesson 1.3: Input, output and strings
  4. Lesson 1.4: Identifiers and assignment
  5. Lesson 1.5: Arithmetic and translation
  6. Lesson 1.6: Trace and review a sequence
  7. Lesson 1.7: Conditions and two-way flow
  8. Lesson 1.8: IF THEN and indentation
  9. Lesson 1.9: IF THEN ELSE and decision diagrams
  10. Lesson 1.10: Ordered ELSEIF and fallback ELSE
  11. Lesson 1.11: Match flowchart and pseudocode branches
  12. Lesson 1.12: AND, OR and NOT
  13. Lesson 1.13: Grouping, precedence and review
  14. Lesson 1.14: Why software searches
  15. Lesson 1.15: A successful linear search
  16. Lesson 1.16: An unsuccessful search and termination
  17. Lesson 1.17: Practise and communicate the search
  18. Lesson 1.18: Translate conditions into Python
  19. Lesson 1.19: One-branch IF programs
  20. Lesson 1.20: Two-way IF ELSE programs
  21. Lesson 1.21: Ordered ELIF choices
  22. Lesson 1.22: Ranges and independent decisions
  23. Lesson 1.23: Boolean operators in Python
  24. Lesson 1.24: Design and test recommendations
  25. Lesson 1.25: Trace, debug and reflect
  26. Lesson 1.26: Choose data types and recognise Boolean literals
  27. Lesson 1.27: Set and use Boolean flags
  28. Lesson 1.28: Explain and identify constants
  29. Lesson 1.29: Express constants in three algorithm forms
  30. Lesson 1.30: Use a fixed factor in a calculation
  31. Lesson 1.31: Cast to Boolean and validate an empty response
  32. Lesson 1.32: Recall calls and trace return values
  33. Lesson 1.33: Supply parameters and reuse library code
  34. Lesson 1.34: Choose and import libraries responsibly
  35. Lesson 1.35: Round with floor and ceiling
  36. Lesson 1.36: Use pi and investigate another mathematical feature
  37. Lesson 1.37: Generate random choices within bounds
  38. Lesson 1.38: Investigate random real values and review library use
  39. Lesson 1.39: Retrieve test tables and predict selection outcomes
  40. Lesson 1.40: Decompose everyday problems
  41. Lesson 1.41: Decompose programs and organise shared work
  42. Lesson 1.42: Develop through repeated build/test cycles
  43. Lesson 1.43: Predict and verify algorithm outcomes
  44. Lesson 1.44: Choose representative and boundary tests
  45. Lesson 1.45: Build, execute and review a test plan
  46. Lesson 1.46: Recall physical inputs and compare transmission media
  47. Lesson 1.47: Configure a radio group and agree a message scheme
  48. Lesson 1.48: Send and receive numbers and strings
  49. Lesson 1.49: Trace numeric message sequences
  50. Lesson 1.50: Transmit text and use received data in conditions
  51. Lesson 1.51: Diagnose and extend a message protocol
  52. Lesson 1.52: Review communication and evidence of testing
  53. Lesson 1.53: Project 1: Adventure story
  54. Lesson 1.54: Project 2: Fire, Water, Earth
  55. Lesson 1.55: Check your progress 1
For grown-ups: using this lesson

Your answers are checked in your browser. Open responses need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Read one explanation, discuss the model and try the readiness check before the workbook. Choose “Mark lesson finished” when ready. Optional account progress saves lesson position and completion across devices; save personal responses before leaving.

2. Fill in your workbook

Read the teaching and complete workbook instructions. Choose, write or draw; Answer list offers larger controls. Trace code precisely and distinguish predictions from actual tests. Review designs, explanations and drawings with a grown-up.

Project 2: Fire, Water, Earth12 student pages · original artwork

Opening your PDF…

Swipe sideways across the worksheet on a small screen, or use “Answer list” for larger controls.

TAKE YOUR PRACTICE OFFLINE

3. Download the student worksheet

All 12 original A4 student pages, ready for pencil-and-paper practice. Choose Review Answers to check your work on this webpage.

Student worksheet only · PDF · 8.5 MiB · No answer key included

Download worksheet PDF ↓

TRY FIRST, THEN CHECK TOGETHER

Download the student worksheet →

4. Answers & guidance

Finished your try? Open the guide and compare one worksheet at a time. Your own words may be different and still explain the right idea.

Shown on this webpage only. There is no answer-key download, and this guide is left out when printing the page.

Show answers for all 12 worksheets

Worksheet 1

  1. Question 1: When can a device decide a round’s result? after both valid choices are available

Worksheet 2

  1. Question 2: Fire against Fire Draw
  2. Question 3: Fire against Water Lose
  3. Question 4: Fire against Earth Win
  4. Question 5: Water against Fire Win
  5. Question 6: Water against Water Draw
  6. Question 7: Water against Earth Lose
  7. Question 8: Earth against Fire Lose
  8. Question 9: Earth against Water Win
  9. Question 10: Earth against Earth Draw
  10. Question 11: My device shows WIN in a completed non-draw round. What should the other show? LOSE

Worksheet 3

  1. Question 12: Round1 A / fire 11
  2. Question 13: Round2 A / fire 21
  3. Question 14: Round1 B / water 12
  4. Question 15: Round2 B / water 22
  5. Question 16: Round1 Shake / earth 13
  6. Question 17: Round2 Shake / earth 23
  7. Question 18: Are the radio group and round identifier the same thing? no, group filters traffic and round labels this game exchange

Worksheet 4

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 5

This page introduces the activity. There are no marked responses on this sheet.

Worksheet 6

  1. Question 19: What happens if a player tries to change a locked choice in this round? choose ignores it
  2. Question 20: What must players coordinate before the next round? both advance once to the same round before choosing

Worksheet 7

  1. Question 21: Received-first step1 None
  2. Question 22: Received-first step2 WIN
  3. Question 23: Received-first step3 None
  4. Question 24: Received-first step4 None

Worksheet 8

  1. Question 25: In round 2, what numeric payload represents water? 22
  2. Question 26: In round 2, how does the core handle old payload 13? ignores it as an unrecognised current-round choice

Worksheet 9

  1. Question 27: What can a paper outcome test certify here? the stated design logic under its assumptions

Worksheet 10

  1. Question 28: What should a duplicate packet do to an already-counted win? add nothing
  2. Question 29: Should the ordinary A+B round reset erase the win total? no, this extension keeps it across rounds

Worksheet 11

  1. Question 30: Agree and explain complete rules and a nine-outcome table. Design each device’s inputs, payloads, received-value comparison and local result output. Use the full three-part core or an equivalent complete design, with a clear reset rule and matching settings. Save complete programs for both devices and a test plan covering ties, every winning case, both viewpoints and relevant event orders. Execute supported practical tests and record actual results or Pending; label paper/model evidence separately. Keep corrections/retests, roles or individual contribution, feedback or Pending and attached evidence. Consistent rules fire>earth, earth>water, water>fire and equal draw, complete nine-outcome table from both viewpoints. Two complete identified source programs (identical supplied core acceptable), matching group27 and round labels, A1/B2/Shake3, payload round*10+choice, receive first recognised current-round choice and decide only when both choices available. Own WIN/opponent LOSE and both DRAW correct, lock choices and avoid duplicate results, reset per-round fields and coordinate both devices. Full saved design/source/test plan and actual/Pending results cover all combinations and relevant ordering/unknown/duplicate cases; paper tests not radio proof. Corrections/retests, contribution/actual feedback and honest limitations retained. Grown-up review; personal evidence is required.

Worksheet 12

  1. Question 31: Demonstrate a coordinated new round in your design, checking both round labels and cleared choice/result state, and predict an old-round message and unknown payload. Record actual observations or Pending, retaining source and test evidence. After a complete core round works, optionally add a win counter and test a win, loss, draw, duplicate result and another round. Explain which state resets and which total remains, or document a precise extension plan if it is not implemented. Review your contribution, actual feedback or Pending, one remaining communication limit and a next step. Both devices advance once to same round before new choices, reset mine/theirs to0 and shown false, display new round; round2 water22 and old13 ignored by current conditions. Unknown payload no accepted remote choice; no delivery/retry guarantee. Optional counter only after core works, startup0, exactly one increase per completed local win, no increase on loss/draw/duplicate/ignored input, retained across ordinary new round and resets on program restart. Complete source/change plan and predicted/actual-or-Pending evidence, no invented device or peer work. Discuss meaningful finite test limits, packet loss/order or setup concern with actual contribution, feedback/Pending and useful next step. Grown-up review; personal evidence is required.
Back to my workbook ↑

Curriculum & workbook reference

Computing for your homeschool day

Explore Project 2: Fire, Water, Earth with this free Grade 8 Computing lesson. Read one idea together, try the fillable workbook and return to review at your own pace. Download the same student worksheet PDF for pencil-and-paper practice.

Fit learning around your family’s day. There is no timer and no sign-up is needed to use the lesson. An optional account saves your lesson position and completion across devices. Workbook responses and drawings stay in this tab; save a copy of your responses before leaving.

Understand your results

Closed answers are checked in your browser. Drawings and written explanations need grown-up review and are shown separately from the automatic score. Check your work, then use “Retry answers to practise” to revisit mistakes while keeping correct responses.

Choose Review Answers after trying the activity. The guide stays on the webpage; the worksheet download contains only the student pages.

For programme background, visit the Cambridge Lower Secondary Computing overview. PaxaKids provides independent original companion practice.

Book page references identify the related teaching topic. File-management and responsible-data preparation are original PaxaKids material; orientation or contents pages are not presented as teaching citations for those skills. The explanations, characters, programs and exercises here are original PaxaKids companion practice. Practical tasks require the appropriate editor and, where applicable, suitable equipment. A design or paper trace is not a verified hardware result. Only completed, reviewed lessons are listed.

Explore the Cambridge Lower Secondary Computing curriculum for programme background. PaxaKids is an independent learning resource.