NOTE:This question has already been answered atleast two times but the code does not work correctly. The user is not congratulated nor is the computer when they achieve their respective winning scores. For the keep playing loop, any other key to stop playing does not work Write a python program for a pig game that has two players that alternate turns rolling dice. In this case, there will be one human player and one computer player. Each player’s goal is to get 100 points rolled on a normal six-sided die first. Each turn consists of rolling the die repeatedly until you decide to stop or until you roll a 1. For each roll: • If you roll a 2, 3, 4, 5, or 6 –you will add the amount rolled to your score. • If you roll a 1 – your turn ends and you receive zero points for that entire turn (You will keep whatever points you had before your turn started) • If you decide to stop rolling at any point in your turn, your points for that turn are then added to the overall score. The overall score is then safe from future rolls.Use functions to break apart the code into logical portions

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.6: Nested Loops
Problem 2E
icon
Related questions
Question

NOTE:This question has already been answered atleast two times but the code does not work correctly. The user is not congratulated nor is the computer when they achieve their respective winning scores. For the keep playing loop, any other key to stop playing does not work

Write a python program for a pig game that has two players that alternate turns rolling dice. In this case, there will be one human player and one computer player. Each player’s goal is to get 100 points rolled on a normal six-sided die first. Each turn consists of rolling the die repeatedly until you decide to stop or until you roll a 1.

For each roll:

• If you roll a 2, 3, 4, 5, or 6 –you will add the amount rolled to your score.
• If you roll a 1 – your turn ends and you receive zero points for that entire turn

(You will keep whatever points you had before your turn started)
• If you decide to stop rolling at any point in your turn, your points for that turn are then added to the overall score. The overall score is then safe from future rolls.Use functions to break apart the code into logical portions

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr