Question: The Pig Dice Game Party MATLAB program should have the following functions: 1. 2. 3. Ask the game host to input how many human players


The Pig Dice Game Party MATLAB program should have the following functions: 1. 2. 3. Ask the game host to input how many human players will play Pig. Ask the game host to input how many computer players will join the competition. Sum up the total number of human and computer players and use player 1, player 2, player 3, .. to represent each human and computer player. We will let the human players to play before the computer players 4. Welcome the players and briefly explain how to play the game when the program starts 5. 6. Track and print the player number in the command window to indicate which 7. If this is a human player, the program should ask the player to decide if the player 8. For computer players, the program should automatically decide to roll or to pass Track and print the current turn number in the command window player should play. For example, "Player 3, it is your turn to play! wants to roll or pass the turn. using the following winning strategy and print the player's decision on screen. a. If one of the opponents has a game score that is 96 or higher and the computer player game score is 76 or higher, keep rolling until the computer player accumulate enough points to sum to 100, and then pass. b. Else if the computer player's game score is less than or equal to 80 points, keep rolling until the computer player accumulate 20 points and then pass. Else, keep rolling until the computer player accumulate enough points to sum to 100, and then pass c. 9. If the human or computer player wants to roll the dice, generate one random integer between 1 and 6 to represent the face value of the dice and print the dice value in the command window a. If the value of the dice is equivalent to 1, set the player's turn score to 0, print a message to tell the player's turn is over with 0 score from this turn, and automatically let the next player play
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
