" alt="Cancel" title="Close" />

How to make Stone-Paper-Scissors Game using AI

In a world where technology and innovation are constantly reshaping the way we live, play, and interact, it’s no surprise that even the simplest of games are getting a high-tech makeover. Talk about the classic game of “Stone, Paper, Scissors,” and imagine infusing this timeless game with the power of Artificial Intelligence and Makerboard technology – the result is nothing short of extraordinary.

Now let’s get into it without further ado;

There are two parts of this project: First, we have to create a program in AMS AI and then a program on the Avishkaar Makerboard. Let’s see what we have to code on these respectively.

AI Code: You need to create a code in AMS AI, to detect your hand gestures. ● Step 1: Create a Model

● Step 2: Create different labels and train your model with different hand gestures

● Step 3: Create a code to detect the labels;

○ If the label detected is None: The Controller will send 0 via bluetooth.

○ Else: The Contoller will send a random value between 1 & 3.

With this your AI Code is ready.

AI code on AMS

Makerboard Code: For this you need the actual Makerboard 2.0 controller, You will make a progam for this:

● Step 1: Initialize a variable “Gesture” to store data

● Step 2: Initialize a Repeat While Loop

● Step 3: Start the bluetooth communication: Receive String data

● Step 4: Store Received String in the Variable “Gesture”

● Step 5: If Gesture == 1: Show Paper Pattern

● Step 6: Else If Gesture == 2: Show Scissor Pattern

● Step 7: Else If Gesture == 3: Show Stone Pattern

● Step 8: Else if Gesture == 0: Clear the Screen

Now, Just upload this code into the Makerboard, Power it up and go back to AMS AI Code. Connect with Bluetooth & you are ready to play.

Makerboard code

Need a little more help? Check out the video below for a step-by-step tutorial on How to Make this game! Have fun playing.

Embark on your robotics journey today with Avishkaar’s beginner-friendly projects and unlock the endless possibilities of the robotics world!

Join our fabulous community of young, innovative Avishkaaris on WhatsApp here – Let’s Avishkaar Express
Discover all Avishkaar kits here.

Thank you for taking the time to read this blog post! We hope you found it informative and enjoyable. If you’d like to stay updated on future articles, exclusive content, and exciting announcements, we invite you to subscribe to our newsletter.

By subscribing, you’ll be the first to receive our latest posts right in your inbox. You’ll also gain access to special offers and opportunities that we only share with our subscribers.

To subscribe, simply enter your email address in the form provided below.

Recommended Articles

Leave a Reply

Your email address will not be published. Required fields are marked *