subject

Please answer the following in python: Answering the ones that have #TODO from DiceQuad import DiceQuadclass PigPlayer:
WINNING_SCORE = 100
AUTO_WIN_RECOGNITION_ON = True
numPlayers = 0
def __init__(self, owner, name = "Player"):
self. owner = owner
self. name = name
self. dice = DiceQuad()
self. score = 0
self. roundScore = 0
self. isPlayerTurn = False
PigPlayer. numPlayers += 1
def reset(self):
''Resets all player values to their default value at the start of a game''
#TODO
pass
def getName(self):
'''Return the name of the player'''
return self. name
def getCurrentScore(self):
'''Return the current score of the player. If it is currently the player's turn,
include the round score'''
#TODO
pass
def hasWon(self):
'''Return boolean if the player has won'''
#TODO
pass
def __str__(self):
'''String representation of this class is the current total score, along with the
current round score (which could still be lost, in the case the turn is still
on), or the last round score, if it's the other player's turn'''
return (self. name + "\'s score: \t" + str(self. getCurrentScore()) + "\t"+
(" (this round so far: " if self. isPlayerTurn else " (last round's score: ")+ "\t" + str(self. roundScore) + ")")
def displayNum1s(self):
'''Prints a message about how many 1s were rolled. Also prints what happens as a consequence.
EX:
Player 1 rolled 3 ones
Player 1 loses all points'''
num1s = self. dice. num1s()
print(self. name + " rolled " + str(num1s) + " ones")
if(num1s == 1):
#TODO
pass
elif(num1s == 2):
#TODO
pass
elif(num1s == 3):
#TODO
pass
elif(num1s == 4):
#TODO
pass
def displayDice(self):
print(self. dice)
def displayDoRoll(self):
self. owner. displayScores()
print(self. name + " rolls... ")
def doRoll(self):
'''Rolls the dice for the player. Based on the number of 1s left, either asks the player if they want to roll again
or ends the turn with the proper consequence. If AUTO_WIN_RECOGNITION_ON is True, ends the turn automatically when
player has won including the most recent roll'''
self. displayDoRoll()
self. dice. roll()
self. displayDice()
num1s = self. dice. num1s()
if(num1s == 0):
#TODO
pass
elif(num1s == 1):
#TODO
pass
elif(num1s == 2):
#TODO
pass
elif(num1s == 3):
#TODO
pass
elif(num1s == 4):
#TODO
pass
def doTurn(self):
'''Performs a full turn for the player'''
self. roundScore = 0
self. isPlayerTurn = True
while (self. isPlayerTurn):
self. doRoll()
if(self. isPlayerTurn):
self. isPlayerTurn = not self. wantsHandOver()
self. score += self. roundScore

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
While inserting images, the picture command is usually used to insert photos from a digital camera, and the clip art command is usually used to a.edit the sizes and other characteristics of photos that have been inserted. b.take a screenshot of an image and copy it to the clipboard for pasting. c.search for drawings or other images from a library of prepared pictures. d.make illustrations using lines and shapes that are easy to manipulate.
Answers: 1
question
Computers and Technology, 23.06.2019 19:30
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a,b] se pot scrie ca produs de două numere prime? “.
Answers: 3
question
Computers and Technology, 24.06.2019 10:00
What did i do wrong with this const discord = require('discord.js'); var bot = new discord.client(); const token = 'ntm3mjcxmtu1mjg3ote2ntq2.dyogew.dpfiwfpuifzuzvifop-csuxasnm' const prefix = "! " bot.registry.registergroup('simple', 'simple'); bot.registry.registerdefaults(); bot.registry. + '/commands'); bot.on('message', message => { if(message.content == 'hi! ') { message.channel.send ('@everyone sup, how is @everyone day going'); } if(message.content == 'h3lp') { message.channel.send ('dose not have any commands yet'); } bot.on('ready', function() { console.log("ready") }); bot.login(token);
Answers: 1
You know the right answer?
Please answer the following in python: Answering the ones that have #TODO from DiceQuad import Dice...
Questions
Questions on the website: 13722362