Teach a Computer Rock-Paper-Scissors
Take webcam photos of rock, paper, and scissors, train a model, and play the game in Scratch. Variety in the photos matters more than how many you take.
At a glance
The computer does not know what scissors look like until you show it. Lane’s classroom version trains an image model on three hand shapes, then plays rock-paper-scissors in Scratch. The moment he cares about is the retry: photos that are almost copies of each other fail, and photos from new angles work better.
Tools (and their age limits)
| Tool | What it’s for here | Account age / who logs in | Free? |
|---|---|---|---|
| Machine Learning for Kids | Train the image model. It shows up as Scratch blocks. | Lane says it is web-based, nothing to install. A teacher or group leader makes the accounts. Children do not need an email. Usernames can be anonymous, like “student1”. You are the group leader at home. | No price in the post. Do not assume a cloud key is free. |
| Scratch | The game: your hand versus the computer’s move | Scratch says it is designed mainly for ages 8–16, and that younger children use it with a parent. Under 16, a new account needs a parent or guardian’s email before it can comment or share. An unverified account can still create and save. You can also use the offline editor and skip the community. | The parents page we read does not list a fee. We did not re-check a store page. |
Who does what
Kid does
- Makes the three hand shapes
- Chooses different angles and distances, on purpose
- Tests with a hand the model has not already trained on
- Says who won, once the game is playing
Parent does
- Creates the accounts and reads the worksheet screenshots
- Points the camera at hands only
- Clicks Train, and waits
- Helps snap the Scratch blocks. Lane calls the script simple. We are not reproducing his blocks from memory.
Materials
- A computer with a webcam
- Machine Learning for Kids, plus the worksheet for this project from the worksheets tab
- Scratch, online or offline
- A plain wall or table, so the photos are of a hand and not a face
Steps
- Parent Open the worksheet from the Machine Learning for Kids worksheets list. Use its screenshots for the clicks. This page is the shape of the lesson, not a second copy of those pictures.
- Together Make three buckets: rock, paper, and scissors. Lane used a fist, a flat hand, and a scissors hand.
- Kid Take photos with the webcam. Change the angle, the distance, and which hand. Lane says a rush of near-identical photos makes a poor model, and a second try with variety helps a lot.
- Parent Check the frame. If a face is in the photo, delete it and shoot again.
- Parent Train the model. In his other examples on the same page, training took a minute or two. He does not repeat that number for this game.
- Together Open Scratch. The new image classifier shows up as blocks. Add the rules of the game so the computer picks a move and can say who won. Follow the worksheet if a block name is unclear. Our prompt tells the chatbot not to invent block names.
- Kid Test with a live photo of a hand, the way Lane describes, not with one of the training pictures.
- Together If it misses, add different photos and train again. That retry is the point of the project.
Copy-paste prompts
These prompts help you talk about the Scratch rules. They do not replace the worksheet.
Scratch rules reminder
Remind us of the rules in Scratch words
I'm a parent helping my child, who is [AGE], finish a rock-paper-scissors game in Scratch. We already trained an image model with three labels: rock, paper, scissors. The model shows up as blocks. Please explain, in short steps, how the blocks should decide a winner: the computer picks its own move, we compare it with the label the model gives our hand photo, and we say who won. Do not ask for a name, a face, or an account password. If you are unsure of a block name in our Scratch, say "check the block drawer" instead of inventing one.Why the model missed
If it keeps missing the hand
Our rock-paper-scissors model keeps calling a [SHAPE] a [WRONG SHAPE]. The training photos may be too alike. Please give us a checklist of different photos to add for each shape: other angles, other distances, and other hands, with no faces in the frame. Then tell us to train again and test on a hand the model has not already seen.
What you’ll end up with
A Scratch project that can name a hand shape and play a round. Lane’s point is the lesson about training data, not a perfect opponent.
Safety box
- Age guidance: 10–12 stay with you. 13+ can click more, with you nearby. This is not a chatbot friendship. Safety & Ages hub
- Hands only. Lane’s photos are of hand shapes. Do not aim the webcam at a face. Delete any photo that includes one.
- No personal info in the account name. Lane says anonymous usernames are fine.
- Do not share the project to the public Scratch community unless you have looked through it. Under 16, sharing needs a verified parent email.
- Money: if the site asks for a credit card or a cloud key with a bill, stop and read it. We did not verify today’s price.
- The worksheet wins on clicks. If this page and the worksheet disagree, follow the worksheet and the screen in front of you.
Age adaptations
| Age | How it works | Tips |
|---|---|---|
| 10–12 | You run the accounts. They pose and help choose photos to delete. | Make the bad model on purpose, then the varied one, so the difference is obvious. |
| 13+ | They can drive the clicks while you watch the camera frame. | Ask them to explain why the first model failed, before you add photos. |
Variations & next projects
- No webcam yet: play with paper hands and sort them into three piles. That is the same idea, offline.
- A sound version is the clap-to-jump project, which uses a different tool.
- Other worksheets on Lane’s list include a text model and a numbers model. They are separate projects. This page stops at rock-paper-scissors.
Source & inspiration
Three picture buckets for rock, paper, and scissors, webcam photos of each hand shape, Scratch blocks that use the model, a script for the rules of the game, and the lesson that near-identical photos make a weak model all come from Dale Lane's introduction to Machine Learning for Kids. He says the worksheets tab has the screenshot steps. The GitHub repo is the worksheet project linked from our launch notes. We opened the repo page and it did not list the files, so this guide does not pretend to be those screenshots. The prompts here are ours.
Inspired by:
- Dale Lane, “MachineLearningForKids.co.uk”
- IBM/taxinomitis-docs, project worksheets for Machine Learning for Kids
Facts checked against:
More in this neighborhood
One project in your inbox every week. No fluff.
TODO: connect a weekly-project email service. This form is a placeholder. It does not send or store your address. No third-party signup is wired up.