Question: dice_player.py: Defines the DicePlayer class, which represents the player (and their computer opponent). It takes care of rolling the dice, keeping track of score,
dice_player.py: Defines the DicePlayer class, which represents the player (and their computer opponent). It takes care of "rolling" the dice, keeping track of score, and updating both player's and opponent's scores based upon the roll. only file you will have to write code for is dice_player.py, in three of its methods: - present_scores: Write code to assign to the variable current_leader the String representing whichever player is ahead -- or "Actually, it's a tie (when the two scores are the same) final_scores: Same as the previous, for the variable winner. do_roll: This is a complex method that will need to accomplish a number of things: 1. Announce that the player is rolling. (Already taken care of.) 2. Roll and get the values of each die - first and second - along with their difference (and sum, if needed.) 3. Announce what the player has rolled: the value of each die (in order) and the sum of the two. 4. Based on the values: Make a decision about how to update each player's score, make the updates, and announce the nature of the updates. (See the sample output below.)
Step by Step Solution
There are 3 Steps involved in it
Rhe diceplayerpy file that implements the DicePlayer class with the requested methods python import ... View full answer
Get step-by-step solutions from verified subject matter experts
