Write a program that allows a single player the user to


Game Specification:

Write a program that allows a single Player (the user) to play a simple four dice game of chance against "The Odds".

There is a single player, with four six sided die.

The sides of each die are labeled with the numbers from 1 to 6, we will call this the value of the die.

A game is made up of rounds, a single round is played as such:

The player rolls their four dice - you may use randi()

The dice are displayed, in some reasonable format.

The user is given the option to re-roll (up to two of their dice) and specify exactly which die they wish to re-roll.

The dice are displayed, in some reasonable format.

A determination is made as to whether or not the player won the round, this determination is made via the following rules:

A Quad is when all the dice have the same number on their top faces. If the player has any Quad then they receive 108 "win"s

A Triple is when exactly three of the dice have the same number on their top faces. If the player has any Triple then they receive 6 "win"s

A Two-Pair is when exactly two dice have the number n1 on their top faces, exactly two dice have the number n2 on their top faces, and n1 is not equal to n2. If the player has any Two-Pair then they receive 4 "win"s

A Junker is then anything that is not listed above. If the player has any Junker then they they receive 1 "lose"

The result of the round (with respect to the Player) is reported.

The player is asked if they wish to play another round.

Once the player indicates that they do not wish to play another round: Before exiting, the program displays a short report stating how many rounds were played, of those - how many were won and how many were lost.

Outline:

Create a MATLAB Script .m file

Write the necessary MATLAB commands to meet the game specification given above

Make sure to test your "program" when it is done

You really need to run your program a number of time to do this thoroughly

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a program that allows a single player the user to
Reference No:- TGS02876788

Expected delivery within 24 Hours