Create and play against AI - Rock, Scissors, Paper Game
This challenge has been written by Kristina Slišurić and is part of the EU CODE WEEK CHALLENGES.

Duration
90 minutes
Experience
Intermediate
Target Audience
- Teachers and educators
- Lower Secondary School students (12 to 16 years)
Purpose
- to understand how the machine learning cycle works.
- to build a machine learning model using Teachable Machine
- to familiarize yourself with the Pictoblox tool and import the created model into the project
- to set the stage and characters, create and initialize variables in Pictoblox
- to initialize the game, identify player movements, program random AI movements
- to create and test a game that involves artificial intelligence as an opponent in a game of Rock, Paper, Scissors.
Recommended Materials
Create and play against AI - Rock, Scissors, Paper Game
Teachers and educators
Lower Secondary School students (12 to 16 years)
Description
We will create a model using Teachable Machine from images using three classes: Rock, Scissors and Paper. Model will be loaded into Pictoblox and used to create game which we can play against AI.
Instructions
- Create a new image project on Teachable machine with 3 classes named Rock, Paper, and Scissor. For each class, capture via camera at least 400 pictures. Make sure to have a clear background. Train and export the model. Upload model and copy link.
- Create a free account on Pictoblox site. Add a Machine Learning Extension and upload a model. Set the stage, variables and sprites. Initialize the game, identify player moves and the moves of AI and who wins the round.
Teachable Machine:
-
Train the data for the game.
-
Testing the model.
Pictoblox:
-
Export the model.
-
Add machine learning extension and load the model.
-
Set up the stage, variables and Sprite.
-
Initialize the game.
-
Identify Player’s Moves.
-
Set random AI Moves.
-
Broadcast random AI moves.
-
Make three blocks. Who wins the round?
-
Check if the player wins the round.
-
Check if the AI wins the round.
-
Check if round is a draw.
-
Program blocks.
-
Rock Paper Scissors Sprite
Share the link to your work in your Instagram Bio: tap the Edit Profile button on your Instagram and add the link to your work in the Website field. After that, create a new post, add a screenshot of your work, write “Link in Bio”, add the hashtag #EUCodeWeekChallenge and mention @CodeWeekEU.
Example
