Question: Pleased write a program that allows your computer program play the rock-paper-scissors-lizard-spock game against itself. Refer to http://en.wikipedia.org/wiki/Rock-paper-scissors-lizard-Spock for more information.
In this problem, the program simulates two players who play against each other. The play continues until one of the computer-generated players wins 4 times. Solve the problem using a class called "RockPaperScissorLizardSpock". Feel free to use as many other classes as needed to make proper use of OOP design.
The program should use multiple threads to simulate "simultaneous play", just as in the real game itself. Use multi-threading / concurrency techniques to simulate the actual game's simultaneous play method where both players throw their hand at the same time for each iteration of the game and then determine who wins this play.
In this game, in every iteration, two random integers are generated in the range of [1 to 5] – 1 refers to Rock. 2 refers to Paper. 3 refers to Scissors. 4 refers to Lizard. 5 refers to Spock.
For example, if the computer randomly generates integers 2 and 5 in the first iteration, 2 is for the first player and 5 is for the second player. 2 refers to Paper and 5 refers to Spock. Based on Rule 8 in the following 10 rules, Paper (2) disproves Spock (5), so player 1 wins.
Likewise, continue the iterations until one player wins 4 times. All other outcomes such as the "Spock vs. Spock" would be considered a draw. Also, ensure that the play ends after a certain number of iterations. Use custom Exceptions with try/catch and not accept any system error message.
rule 1: Scissor cut paper
rule 2: Paper covers rock
rule 3: Rock crushes lizard
rule 4: Lizard poisons Spock
rule 5: Spock smashes (or melts) scissor
rule 6: Scissor decapitate lizard
rule 7: Lizard eats paper
rule 8: Paper disproves Spock
rule 9: Spock vaporizes rock
rule 10: Rock breaks scissors
We are a professional custom writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework.
Yes. We have posted over our previous orders to display our experience. Since we have done this question before, we can also do it for you. To make sure we do it perfectly, please fill our Order Form. Filling the order form correctly will assist our team in referencing, specifications and future communication.
2. Fill in your paper’s requirements in the "PAPER INFORMATION" section and click “PRICE CALCULATION” at the bottom to calculate your order price.
3. Fill in your paper’s academic level, deadline and the required number of pages from the drop-down menus.
4. Click “FINAL STEP” to enter your registration details and get an account with us for record keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
5. From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.
Need this assignment or any other paper?
Click here and claim 25% off
Discount code SAVE25