ReactJS developer interview test:
Write a program that will play this game against the computer. The game should end once there is a winner. If the game is a tie then the program must make the user play again, until there is a winner.
Once there is a winner, the program (game) must end. When the program begins, a random number is created between 1 and 5.
These values will be used as follows:
-
Rock
-
Paper
-
Scissors
-
Lizard
-
Spock
Use a menu to prompt the user for their choice, using the same values as above. The program should then display the computer’s choice and indicate who has won.
A winner is selected using the following rules:
-
Scissors cut paper
-
Paper covers rock
-
Rock crushes lizard
-
Lizard poisons Spock
-
Spock smashes (or melts) scissors
-
Scissors decapitate lizard
-
Lizard eats paper
-
Paper disproves Spock
-
Spock vaporizes rock
-
Rock breaks scissors