Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Spatial And Temporal Databases 8th International Symposium Sstd 2003 Santorini Island Greece July 2003 Proceedings Lncs 2750

Authors: Thanasis Hadzilacos ,Yannis Manolopoulos ,John F. Roddick ,Yannis Theodoridis

2003rd Edition

3540405356, 978-3540405351

More Books

Students also viewed these Databases questions

Question

Define the term Working Capital Gap.

Answered: 1 week ago

Question

Discuss five types of employee training.

Answered: 1 week ago

Question

Identify the four federally mandated employee benefits.

Answered: 1 week ago