Predicting Roshambo with a Calculator


Roshambo?

Rock, Paper, Scissors is known by many names across the world, and is played by various cultures throughout history. It is a simple hand game often used to break ties due to the perceived randomness of the game. However, humans are incapable of true randomness and tend to form patterns unless deliberately avoiding so. This simple fact forms the basis of competitive RPS tournaments. Knowing this, I created a simple Neural Network to take advantage of these patterns inherent in human nature.

Image Curtesy of Wikipedia Commons

What am I looking at?

This project is a simple classification network I created by hand. The only import I use for this program is numpy. I designed this network to learn Rock, Paper, Scissors using only an input of the player’s previous six moves. The theory behind this is that humans are inherently nonrandom and tend to do things in patterns — even if the pattern “feels” entirely random. This network is intended to exploit that lack of randomness by determining the pattern a human player uses as quickly as possible and begin winning.

Image Curtesy of Wikipedia Commons

What is a Classification Network?

A classification network is a neural network that takes in some values and performs some simple mathematical operations to get a single output. The input values can really be any set of values, as long as they have some consistent correlation to the output. In the case of this project, I am using the player’s last six moves (the movie history is filled with some “dummy” values to help the network get used to “playing” initially) but with one slight modification — given the value of the move (-1 is Rock, 0 is Paper, 1 is Scissors) I add or subtract 0.3 from the player’s move in their move history depending if they won or lost that game. This is to give the network slightly more information about the gamestate without increasing the number of input values. Now this all sounds incredibly difficult to code, but it is actually very simple due to how small the network is — in fact, here’s an image of the entire network.

Image Curtesy of Notepad++ and My Own Hands. All following images are my own.

Behind the Scenes of My Network

Galen Holland 2022