Goals 1–4 are this lesson; goals 5–6 are next lesson.
Level 1: play the game, spot patterns, and think like a coder. Task 1: play Rock–Paper–Scissors on your micro:bit — shake it to play one round. (Need the program? See the Starter code & help tab.)
| Question | Your answer |
|---|---|
| What do you do to start the game? | |
| What appears on the screen? | |
| Does it always show the same result? | |
| Why do you think this happens? |
Fill in the model:
Task 2: complete the logic below to show how Rock–Paper–Scissors works.
Task 3: improve your program. Choose an idea, explain your plan, predict what should happen, then test it.
Choose one or more:
| Design step | Your thinking |
|---|---|
| Step 1 — Choose: which feature will you add? | |
| Step 2 — Plan: what will the player do? What will the micro:bit do? | |
| Step 3 — Predict: what do you think will happen when you test it? | |
| Step 4 — Test: what happened? What will you fix? |
Build, test in the simulator, then download the .hex to your micro:bit. Your code is saved inside the editor on this computer (separately from your workbook answers). If the editor doesn't load below, your school network may block it — use the “Open in a new tab” button.
In the micro:bit Editor tab, switch the editor to JavaScript (the { } JavaScript button at the top), select all, and paste this in. Switch back to Blocks to see it as blocks. Shake the micro:bit to play.
input.onGesture(Gesture.Shake, function () { let choice = randint(0, 2) if (choice == 0) { basic.showString("R") // Rock } else if (choice == 1) { basic.showString("P") // Paper } else { basic.showString("S") // Scissors } })
basic.showLeds or showIcon once it works.