Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DSC 4 3 0 : Python Programming Assignment 0 5 0 2 : Rolling Game For this problem you will use the classes from the
DSC : Python Programming
Assignment : 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 and This number will be called the goal.
Ask the user how many of each die or 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 scores.
Otherwise, if the roll is within of the goal but not over, the user receives scores.
Otherwise, if the roll is within of the goal but not over, the user receives 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 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 DL 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.
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