Question
Using Java, create a program that allows SIX players (identified as player 1 through player 6) to play a dice game as follows. Each round,
Using Java, create a program that allows SIX players (identified as player 1 through player 6) to play a dice game as follows. Each round, each player rolls a 20-sided die, simulated by generating a random number between 1 and 20. The value they roll is then added to their current total, which starts at 0 initially. At the end of the round, any player with a score OVER 100 is eliminated from the game. Keep on playing the game until only one player remains, the winner. If all remaining players are eliminated in a particular round, then no one is the winner.
Player scores should be shown at the end of each round. At the end, print the winner, and how many rounds the game went.
RECOMMENDATION: Build the program in parts, doing one thing at a time. Then, once one part is working, add on to it with the next part, and so on. That way, you have some components working in case you canot get it all working.
Some ideas on separate parts:
- Create an arraylist of for the 6 players, with each element at 0
- Print the arraylist
- Randomly roll a number from 1-20 for all 6 players ONCE
- Put it into a loop
- Check each player for being over 100
etc ...
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