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]
2 years ago
14

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

Computers and Technology
1 answer:
zalisa [80]2 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
Explain the need for data structures when developing software.
Sergio [31]

Solution:

It is  important because, it has to do operation on so without, data structures and algorithms.

It performs these operation:  

 1)Take an input

2) Process it  

3) Give back the output.

The input can be in any form, for ex while searching for directions on google maps,  the starting point and the destination as input to google maps, while logging in to any social sites, We have to give our email and password as input and so on.

Similarly, in the third step, the computer application gives us output in some form or the other.

To make this process efficient, we need to optimize all the three steps.

4 0
3 years ago
Plz help meeeeee QUICKLY!!! WORTH 15 POINTS!
Lady bird [3.3K]

Answer:

Im pretty sure Domain name system but dont trust me

Explanation:

8 0
3 years ago
In symmetric encryption the same key is used to encrypt and decrypt a message. in asymmetric encryption different keys are used
Brrunno [24]

A useful advantage of Asymmetric encryption over symmetric encryption is that there is no secret channel necessary for the exchange of the public key, unlike in the symmetric encryption which requires a secret channel to send the secret key.  

Another advantage of Asymmetric encryption is that is has increased security. Asymmetric uses two different keys (Public and private) for both encryption and decryption of data while symmetric uses one.

5 0
3 years ago
Read 2 more answers
HOW CAN YOU GET THE COOLEST FONTS ON GOGGLE SLIDES???
Viefleur [7K]
I would love to help. but if you could text my number i could help more. i have a chromebook
8 0
2 years ago
Read 2 more answers
Solve for x<br><br>4d+3/8=-2​
Alexxx [7]

Answer:

-19/32

Explanation:

(If I assume d to be x)

4x+3/8=-2

or,4x=-2-3/8=-19/8

or,x=(-19/8)*(1/4)=-19/32

5 0
3 years ago
Other questions:
  • Which part of a window lets you see a fileâs contents without opening the file?
    9·1 answer
  • How do I take off the header off my second page in google docs ? ( I only need it on page 1)
    8·2 answers
  • Given that two int variables, total and amount, have been declared, write a sequence of statements that: initializes total to 0
    14·1 answer
  • What is used to monitor the activity of a network and notify network administrators when it identifies something as suspicious?
    15·1 answer
  • Compressing a file is also called
    9·2 answers
  • A retail company must file a monthly sales tax report listing the total sales for the month and the amount of state and county s
    11·1 answer
  • Consider the following program where the zu format specifier is used to display as an integer the result of sizeof. #include #in
    11·1 answer
  • Which term is used in object-oriented programming to reference characteristics of an object?
    15·1 answer
  • The maximum number of characters that a cell can contain is
    11·2 answers
  • HELP ME PLEASE ASAP
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!