java program simulating darts
i need to write a program that does this
You are required to write a simple program that simulates a game of darts. In this, two (or more)
players take turns to “throw“ three darts to reduce their score from 501 down to zero. Each dart
thrown will be simulated by a pair of numbers – the first is the number scored (1-20, 25, 50), the
second indicates a single double or treble if one is possible (note that 25 or 50 are always singles, so
the first number will dictate whether the second value is necessary). After three throws, the full score
will be deducted from 501. The first player to zero wins. However, as with real darts, the final dart
must be a double or bullseye (50), and must exactly clear the remaining score. If too much is scored,
the player is out for that turn, and must try again after the other players have had a turn.
On-screen, each turn should generate:
1. Each of the three Throws’ scores, with doubles and trebles included
2. The total score achieved in a Turn, by summing all three
3. The remaining score, having deducted from the total at each turn
4. An indication of ‘bust’ if the player ‘s darts total more than the remaining score, or ‘win’ if the
player has got out with a double or bullseye (note that if the player gets out on the first or
second dart, this is a win – the remaining dart(s) do not need to be thrown).
can anyone advise me on what structure to use? or what algorithms would need to be included. has anyone already wrote a program like this?