Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION:1 PLEASE solve this using Java code: Elimination is a one-player game. The board consists of a set of 12 tiles, numbered 1 through 12.
QUESTION:1 PLEASE solve this using Java code: Elimination is a one-player game. The board consists of a set of 12 tiles, numbered 1 through 12. The player rolls a pair of dice and marks tiles as removed based on the numbers shown on the dice. For each roll, the player can either "mark removed" the two tiles corresponding to the numbers shown on each die or a single tile corresponding to the sum of the numbers on each die. If the player rolls doubles (the same number on both die), the player can "mark removed" only the tile corresponding to the sum of the numbers on each die. Play continues until the player cannot make a legal move after rolling or all the tiles have been "mark removed". The sum of the remaining tiles is the player's score. The goal is to have a low score. In addition to playing the game, your application should keep track of the best (lowest) score of all plays during a single run. Here is a sample run of the application: Lowest Score = 78 1 2 3 4 5 6 7 8 9 10 11 12 Dice roll: 43 What is your move (V=values, S=sum, Q=quit)? V 1 2 3 4 5 6 7 8 9 10 11 12 ..XX........ Dice roll: 25 What is your move (V=values, S=sum, Q=quit)? V 1 2 3 4 5 6 7 8 9 10 11 12 .XXXX....... Dice roll: 65 What is your move (V=values, S=sum, Q=quit)? V Try again. What is your move (V=values, S=sum, Q=quit)? S 1 2 3 4 5 6 7 8 9 10 11 12 .XXXX.....X Dice roll: 45 What is your move (V=values, S=sum, Q=quit)? S 1 2 3 4 5 6 7 8 9 10 11 12 .XXXX...X.X. Dice roll: 45 What is your move (V=values, S=sum, Q=quit)? S Try again. What is your move (V=values, S=sum, Q=quit)? V Try again. What is your move (V=values, S=sum, Q=quit)? Q 1 2 3 4 5 6 7 8 9 10 11 12 .XXXX...X.X. Score = 44 NEW LOW SCORE! Lowest Score = 44 Do you want to play again (Y=yes, N=no)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started