1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
jeka57 [31]
3 years ago
14

Please answer the following in python: Answering the ones that have #TODO

Computers and Technology
1 answer:
zalisa [80]3 years ago
5 0

Answer:

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.<em><u>roundScorenxnd</u></em><em><u> </u></em><em><u>dd</u></em>

You might be interested in
What are QBASIC Operators ?​
Anna35 [415]

Answer: There are four types of operators in QBASIC. They are Arithmetic Operators, Relational Operators, Logical Operators and Sting Operator. a. Arithmetic Operators. Arithmetic Operators are used to perform mathematical calculations like addition, subtraction, division, multiplication and exponential. :)

5 0
4 years ago
Read 2 more answers
Which is an appropriate strategy for using a workplace blog?
OLEGan [10]

Answer:

a

Explanation:

8 0
3 years ago
Why should the government create money it doesn’t have?
murzikaleks [220]

Answer:

to increase economy of the country

Explanation:

if the government does so the people will be able to access the money this increasing government revenue. This increasing the economy

8 0
3 years ago
Read 2 more answers
Sophisticated modeling software is helping international researchers (1 point) create more intricate screenplays and movie scrip
tatiyna

Answer: Increase the pace of research in finding and producing vaccines.

Explanation: The modelling software is the software that is used by the international researchers for the purpose of the researching about the vaccines. There are diseases which still don't have any vaccines and they create serious health conditions.

So, researchers are investigating and trying to develop the vaccines with increasing pace.Other options are incorrect because researchers are not looking for the movie scripts, marketing products and evidences.

8 0
4 years ago
The 169.254.78.9 ip address is an example of what type of ip address?â
saul85 [17]
The 169.254.0.0/16 network is for self-assigned addresses.
3 0
4 years ago
Other questions:
  • Because HTML was designed as a cross-platform language, it is the preferred method of communicating with back-end databases. Tru
    8·1 answer
  • Which topology connects all the computers in a circular pattern
    13·2 answers
  • What is the difference between a software package and integrated software
    7·1 answer
  • Which statement demonstrates a conflict of interest in an organization?
    9·1 answer
  • The Internet is not a good place to connect with people when looking for a job.
    10·1 answer
  • What is an Action Button?
    10·1 answer
  • Your company has purchased another company that also uses Windows Server 2016 and Active Directory. Both companies need to be ab
    11·1 answer
  • kayah has created a website that explains what her business does. what type of computer program is needed to access/view kayah's
    7·2 answers
  • What are the cloud storage components
    6·1 answer
  • I can login to it says to me u cant login at that time
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!