Technologies K–10 · Years 5–6
micro:bit rock, paper, scissors: random numbers, variables and branching
Design and Production (NSW Science and Technology K–6, 2017) (algorithms); Digital Technologies: Processes and production skills, Producing and implementing (ACARA v9)
This site has no interactive model of its own. Where a step or a material names a Concept Studio model, simulation or tool, it has not been built; an external simulation a step names (for example PhET) is not part of this site.
The idea
A visual program stores a random number in a variable and branches on it to show rock, paper or scissors, and counting 60 results tests whether each branch comes up about a third of the time.
What you need
- 1 BBC micro:bit per learner with a battery pack (2 AAA cells)
- Computer with the MakeCode editor and a USB cable
- Tally sheet
How to do it
- With the class, write a user story and design criteria, for example: as a player, I want the micro:bit to choose fairly so that neither player has an advantage; criteria: all three icons can appear, and each comes up about a third of the time over many shakes.
- Program: on shake, set the variable hand to a random number from 1 to 3; if hand = 1 show a rock icon, else if hand = 2 show paper, else show scissors.
- Add three counting variables that go up by 1 for each result, and show all three when button A is pressed.
- Test each branch: set hand to 1, then 2, then 3 by hand and check the icon, then put the random number back.
- Shake 60 times. Check the three counts add to 60 and record them.
- Pool the class results and compare with one third of the total.
- Evaluate the game against the design criteria, using the counts as evidence, and say whether it is fair enough for a class tournament.
What you should see
Each result has a chance of one in three, so 60 shakes give about 20 of each, but the counts vary from learner to learner: a count a few above or below 20 is normal variation, not a bug, and pooled class data sits closer to one third each. A count of 0 for one result points to a bug, such as a random range of 1 to 2 that never picks 3. The learner knows it worked when all three icons appear, the counts add to 60 and the game meets the class's design criteria.
What changes
This activity lists no variables to change, measure and keep the same.
Common misconceptions
Each of these ideas is wrong, and the activity is a chance to test it.
- If the program is fair, 60 shakes give exactly 20 of each (random results vary around 20).
- After three rocks in a row, paper is due (each shake is independent).
- A bug always shows up the first time the program runs (a wrong random range may only show over many shakes).
Safety card
Hazards
- Dropping the micro:bit while shaking
Controls
- Hold the micro:bit firmly over the desk
Note
No chemicals or heat.
Curriculum references
The NSW syllabus outcomes and Australian Curriculum v9 codes this activity supports. They are references, not a verified or complete curriculum alignment.
- Science and Technology K–6 Syllabus (2017), NESA. The syllabus taught in 2026; the 2024 syllabus replaces it from 2027. Code read from the official syllabus document (DOCX) on 2026-09-22.ST3-3DP-T
- Science and Technology K–6 Syllabus (2024), NESA. Implementation from 2027, so this code describes the future syllabus. Code read from the outcomes page on 2026-09-22.ST3-DDT-02
- Australian Curriculum v9AC9TDI6P05AC9TDI6P06
Sources
The pages the author read to write this activity.
- www.nsw.gov.au/education-and-training/nesa/curriculum/science/science-and-technology-k-6-2017
- curriculum.nsw.edu.au/learning-areas/science/science-and-technology-k-6-2024/outcomes
- microbit.org/projects/make-it-code-it/rock-paper-scissors
- www.digitaltechnologieshub.edu.au/search/introduction-to-micro-bit-sensors-buttons-and-lights