1. (20 points) Implement the DiceShaker class. The DiceShaker uses the Die class. This class allows you do roll multiple dice at the same time and get the individual rolls or a count of all the rolls.
a. init () takes two optional parameters. First parameter is the total dice in the shaker (default 1) and how many sides each of the die has (default =6)
b. shake() : Goes through all the Die stored in the shaker and calls the roll method on them.
c. getTotalRoll() : returns a integer of the total of all dice in the shaker. You must call the get() method on each die in the shaker.
d. getIndividualRolls() : returns a list of integer values that represent the face of all the dice in the shaker. You must call get on each of the dice in the shaker to put together the list.
e. str (): Displays the string value of each of the current values of the dice. Must be obtained using the get() method of each Die.
The following shows how the DiceShaker class and methods could be used:
class DiceShaker(object):
'DiceShaker class'
def __init__(self,dieCount=1, dieSides=6):
'initialize a dice shaker'
pass
def shake(self):
'shake all the dice in the shaker'
pass
def getTotalRoll(self):
'get the total face value of all the dice'
pass
def getIndividualRolls(self):
'get a lsit of integers of all the individual die rolls'
pass
def __str__(self):
'get a string with all the die rolls seperated by a space'
pass