I need the JOptionPane code for this assignment
Here is how the output should look
11. First to One Game This game is meant for two or more players. In the game, each player starts out with 50 points, as each player takes a turn rolling the dice; the amount generated by the dice is subtracted from the player's points. The first player with exactly one point remaining wins. If a player's remaining points minus the amount generated by the dice results in a value less than one, then the amount should be added to the player's points. (As an alternative, the game can be played with a set number turns. In this case, the player with the amount of points closest to one, when all rounds have been played, wins.) Write a program that simulates the game being played by two players. Use the Die class that was presented in Chapter 6 to simulate the dice. Write a Player class to simulate the players.
Die - SIDES: int = 6 - value : int + Die() + roll(): void + getValue(): int
Example: Message 0 Round 1: James rolled a 4 Sally rolled a 2 James: 46 Sally: 48 OK X
I need the JOptionPane code for this assignment Here is how the output should look
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am