Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THIS PROBLEM IS AVAILABLE TO CHECK ONLINE PLEASE CHECK BEFORE POSTING: http://www.codestepbystep.com/problem/view/python/loops/piglet Write a console program that implements a simple 1-player dice game called Piglet

THIS PROBLEM IS AVAILABLE TO CHECK ONLINE PLEASE CHECK BEFORE POSTING: http://www.codestepbystep.com/problem/view/python/loops/piglet

Write a console program that implements a simple 1-player dice game called "Piglet" (based on the game "Pig"). The player's goal is to accumulate as many points as possible without rolling a 1. Each turn, the player rolls the die if they roll a 1, the game ends and they get a score of 0. Otherwise, they add this number to their running total score. The player then chooses whether to roll again, or end the game with their current pototal. Here is an example dialogue where the user plays until rolling a 1, which ends the game with 0 points:

image text in transcribed 
piglet Language/Type: Author: Python Marty Stepp (on 09/13) Write a console program that implements a simple 1-player dice game called "Piglet" (based on the game "Pig"). The player's goal is to accumulate as many points as possible without rolling a 1. Each turn, the player rolls the die if they roll a 1, the game ends and they get a score of 0. Otherwise, they add this number to their running total score. The player then chooses whether to roll again, or end the game with their current pototal. Here is an example dialogue where the user plays until rolling a 1, which ends the game with 0 points: Welcome to Piglet! You rolled a 5 Roll again? yes You rolled a 4 Roll again? yes You rolled a 1 You got B points,. Here is another example dialogue where the user stops early and gets to end the game with 10 points: Welcome to Piglet! You rolled a 6 Roll again? y You rolled a 2 Roll again? y You rolled a 2 Roll again? n You got 18 points

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Have ground rules been established for the team?

Answered: 1 week ago

Question

H0: mean positive critical value

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago