R

ROCK-PAPER-SCISSORS- LIZARD-SPOCK

I have created a Web App with a twist to the original game of rock-paper-scissors having two extra choices i.e. Lizard and Spock. The player plays against a bot and can choose the number of rounds.

Created on 16th May 2021

R

ROCK-PAPER-SCISSORS- LIZARD-SPOCK

I have created a Web App with a twist to the original game of rock-paper-scissors having two extra choices i.e. Lizard and Spock. The player plays against a bot and can choose the number of rounds.

The problem ROCK-PAPER-SCISSORS- LIZARD-SPOCK solves

Because of the limited number of choices in the original Rock-Paper-Scissors game the total permutations of the number of move pairs for a game of players is very low. This leads to a lot of DRAWS while playing and comes out as annoying if the players are enjoying a multi-round game. This problem was also acknowledged by the writers of the famous TV show ‘The Big Bang Theory ' and they produced a solution to this in the form of an improved version of the same.

Challenges I ran into

During development, I ran into the problem of many bugs being created because of the use of if-else statements in JS code in handling a large number of move scenarios in the game. The bugs included wrong color implementations, busted logic, and sometimes a full crash. I overcame this completely by the obvious use of switch statements instead of if-else.

Discussion

Builders also viewed

See more projects on Devfolio