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

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

A. 21.00 B. 18.00 C. 20.00 D. 22.00 E. 25.00

Answered: 1 week ago