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.
Target Audience
  1. Teachers and educators
  2. Lower Secondary School students (12 to 16 years)
Experience
  1. Intermediate
Duration
  1. 90 minutes
Purpose
  1. to understand how the machine learning cycle works.
  2. to build a machine learning model using Teachable Machine
  3. to familiarize yourself with the Pictoblox tool and import the created model into the project
  4. to set the stage and characters, create and initialize variables in Pictoblox
  5. to initialize the game, identify player movements, program random AI movements
  6. to create and test a game that involves artificial intelligence as an opponent in a game of Rock, Paper, Scissors.
Recommended Materials
  1. Teachable Machine
  2. Pictoblox
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?
  • A) Check if the player wins the round.
  • B) Check if the AI wins the round.
  • C) 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
Click here to download this challenge as a word document.