Rock Paper Scissors Lizard Spock (RPSLS) is an extended version of the classical game of chance Rock Paper Scissors. This game is created by Sam Kass and Karen Bryla. his game, the players pick one of the following variables: rock, paper, scissors, lizard, spock. The outcome of the game is determined by the rules below specifying which ariable defeats the other. If both players choose the same variable, the game ends in a draw. Rules: • scissors cut paper • paper covers rock • rock captures lizard • lizard poisons spock • spock smashes scissors • scissors captures lizard • lizard eats paper • paper disproves spock • spock vaporizes rock • rock crushes scissors n this project, you will write a program that takes two strings representing the choices of the players as inputs and prints the outcome of the RPSLS game. There are three ossible outcomo s of this gamo: a tio a win for plaver 1 and a win for playor 2 VoL are sun posed to dotormnine the outcomo doponding on tbe plavere' choices and assian a
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps