Question: PLEASE HELP ME WITH PYTHON CODE * 8 Pig Game Implement a game of Pig where the user plays against a hold at 2 0
PLEASE HELP ME WITH PYTHON CODE
Pig Game
Implement a game of Pig where the user plays against a hold at or
goal computer player that rolls until a pig is rolled, or the turn total
is greater than or equal to or the score plus the turn total is greater than
or equal to The first player is chosen randomly.
Input
An empty input ie Enter indicates that the user wishes to roll. Any
entered line of nonzero length indicates that the user wishes to hold.
Output
Before the game, randomly select which player the user will be and
print the line You will be player # where # is the users player
number. Then, print an instruction line Enter nothing to roll; enter
anything to hold.
Before each turn, print a line with Player score: and player s
score. Print another line with Player score: and player s score.
Finally, print a line with It is player #s turn. where # is replaced
by the current player number. Play starts with player and then
alternates.
For each roll, print a line with Roll: and the random die roll value
For each nonpig roll on the users turn, prompt the user
with Turn total: the turn total, a tab, and RollHold
After a pig roll of or a hold print a line with Turn total:
followed by the turn total. In the case of a pig this turn total is
Then, print a line with New score: followed by the new score for the
current player.
Sample Transcript
You will be player
Enter nothing to roll; enter anything to hold.
Player score:
Player score:
It is player s turn.
Roll:
Roll:
Roll:
Roll:
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHold h
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Roll:
Roll:
Roll:
Roll:
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHold h
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Roll:
Roll:
Roll:
Roll:
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHold h
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Roll:
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHold h
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Roll:
Turn total:
New score:
Player score:
Player score:
It is player s turn.
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHoldEnter
Roll:
Turn total: RollHold h
Turn total:
New score:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
