Question: DSC 4 3 0 : Python Programming Assignment 0 5 0 2 : Rolling Game For this problem you will use the classes from the

DSC 430: Python Programming
Assignment 0502: Rolling Game
For this problem you will use the classes from the previous problem to build a game. The game will work as follows:
Greet the user and ask their name.
Ask them if they would like to play a game.
Initiate a game with zero score for the user.
Generate a random number between 1 and 100. This number will be called the goal.
Ask the user how many of each die (6-,10- or 20-sided) they would like to roll to get as close as possible to the goal.
Create a cup filled with dice according to the user's input.
Roll the cup and display the results.
If the roll exactly matches the goal, the user receives 10 scores.
Otherwise, if the roll is within 3 of the goal but not over, the user receives 5 scores.
Otherwise, if the roll is within 10 of the goal but not over, the user receives 2 scores.
Otherwise, the user does not receive any scores.
Report the results to the user. The message should include their name and updated score.
Ask if they would like to play again. If so, go to step 4. Record a three minute video in which you run the code. Then, present your code. Specifically, answer the following questions:
Show your primary loop and briefly explain how you calculate the score updates.
Describe how you leverage the dice and cups classes from the previous assignment. Use the classes - don't store a bunch of values in the game engine that you need!
Submission: Submit a single .py file containing all the code to the D2L. Do not zip or archive the file. Your code must include comments at the top including your name, date, video link, and the honor statement, "I have not given or received any unauthorized assistance on this assignment." Each function must include a docstring and be commented appropriately.
 DSC 430: Python Programming Assignment 0502: Rolling Game For this problem

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!