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
- Teachers and educators
- Lower Secondary School students (12 to 16 years)
Experience
- Intermediate
Duration
- 90 minutes
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
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.
- Train the data for the game.
- Testing the model.
- 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
Teachable Machine:
Pictoblox:
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.
Copyright notice ©
The EU Code Week website for schools is a service supported by the European Commission
Except where stated otherwise, content made available on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license
Licensing under Creative Commons licenses does not of itself affect the ownership of the copyright
Content from third party websites is subject to their own copyright restrictions; please refer to the site of origin for more information.
The EU Code Week website for schools is a service supported by the European Commission
Except where stated otherwise, content made available on this site is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license
Licensing under Creative Commons licenses does not of itself affect the ownership of the copyright
Content from third party websites is subject to their own copyright restrictions; please refer to the site of origin for more information.