This workshop introduces programming via a simple rock-paper-scissors game. Participants will think about the rules of the game in terms of algorithms.
Preparation time for facilitator
Time needed to complete activity (for learner)
Name of author
Support material needed for training
Resource originally created in
To ensure everyone knows what they are doing for the following sections, start by holding a basic rock-paper-scissors tournament. Ask participants to split into pairs and play one round.
The loser is eliminated and the winner will face another winner and so on until only one person is left.
Those eliminated can watch the following rounds and try to guess the winner.
Writing the rules in groups (10mins)
Divide participants in groups of 3-4 people and ask them to write the rules of rock-paper-scissors together (disregarding tournament rules) in the most precise way – using the fewest words – possible. Leave them 5 minutes, then ask each group to present their result.
The goal is to create debate between participants regarding which rules to keep. Are there superfluous rules ? Which details are missing in which version? Help them think about all aspects by asking them questions, such as ‘can we play with more than two players ?’, ‘how many times do we play?’, etc.
Write the final version together completed and succinct.
Keep in mind these essential elements :
- 2 players only
- Several rounds can be played with each bringing 1 point; the player with the most points at the end wins
- The choice to play rock, paper or scissors is not made visibly
- In the case of the same choice, the round starts again
- Rock beats scissor
- scissor beats paper
- Paper beats rock
Linking to more advanced ideas (5mins)
Discuss with participants the links between this exercise on rule implementation and what will follow this workshop:
- For a workshop based on making a game, emphasise that:
- Even a simple game can have ‘many’ rules
- All possible situations must be anticipated, including how games are won, lost, drawn, and nullified
- Game variants should be considered
- Rules must be finalised before programming begins to know what we will need to work (variables, event chains, etc.)
- Is the game balanced as it is? What is balance and how do we achieve it?
- For a workshop on algorithms :
- Compare the first versions of the rules with the final ones: which are detailed enough for humans and which for computers?
- why do we need to be so precise when we ‘talk’ to a computer?