Question
Write a MATLAB program to simulate the Wild, Wild, West! dice game that can: Automatically play the Wild, Wild, West! dice game for any number
Write a MATLAB program to simulate the Wild, Wild, West! dice game that can:
Automatically play the Wild, Wild, West! dice game for any number of players (input by the game host).
Automatically roll 2 dice for every player participates in the game and clearly print the dice values in the command window.
Automatically sum both dice values together for each player and print the score (the sum of both dice) for everyone participates in the command window.
Automatically find the lowest score of the round and print the lowest score in the command window.
Automatically identify the player(s) with the lowest score and print the player number(s) with the lowest score in the command window.
Automatically reduce one life for the player(s) with the lowest score.
Automatically print the number of lives for every player in the command window at the end of each round.
When a player has lost all lives, the player can no longer participate the game. The program should automatically stop showing the dice rolled by the players with no life. The program should also automatically skip the players with no life when determine which player gets the lowest score of the round.
The game should keep automatically playing until only 1 or 0 player left.
At the end of the game, identify the winning player number and congratulate the winner in the command window.
It is also possible that everyone died at the end of the game. In this case, clearly print a message in the command window.
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