Question
*For MATLAB Project 3: Creating the Pig Dice game in MATLAB Rules for Pig Each turn, a player repeatedly rolls a die until either a
*For MATLAB
Project 3: Creating the Pig Dice game in MATLAB
Rules for Pig
Each turn, a player repeatedly rolls a die until either a 1 is rolled or the player decides to "hold".
-If the player rolls a 1, they score nothing and it becomes the next player's turn.
-If the player rolls any other number, it is added to their turn total and the player's turn continues.
-If a player chooses to hold, their turn total is added to their score, and it becomes the next player's turn.
The first player to score 100 or more points wins.
(For example, the first player, Anne, begins a turn with a roll of 5. Anne could hold and score 5 points, but chooses to roll again. Anne rolls a 2, and could hold with a turn total of 7 points, but chooses to roll again. Anne rolls a 1, and must end her turn without scoring. The next player, Bob, rolls the sequence 4-5-3-5-5, after which he chooses to hold, and adds his turn total of 22 points to his score.)
Also,
Strategize on how you can run many (at least 100) turns of a game that will continue until a '1' is rolled and collect data on the points scored before a '1' is rolled and how many rolls before a '1' is rolled. Is there any other information you want to save to help you develop a threshold for when a computer should stop rolling and bank points?
Create a MATLAB script that allows you to play against the computer. You get to decide when to bank your points and stop your turn (unless you roll a 1) but you must set a rule when computer will stop.
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