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
Which reading strategy refers to reading only the key words and phrases?
kirill [66]
I think the answer is scanning.
6 0
3 years ago
Read 2 more answers
Kiera is building a new computer and wants to make sure she has an adequate power supply for all the new equipment she is purcha
VikaD [51]
700w power supply is very adequate
7 0
3 years ago
Read 2 more answers
What field in an IPv4 packet is altered to prioritize video streaming traffic over web surfing traffic?
Serhud [2]

Answer:

DiffServ (Differentiated Service)

Explanation:

DiffServ (Differentiated Service) field is used to prioritize traffic in IPv4 packet.

DiffServ is used as QoS (quality of service) on networks at Layer 3, replacing former IPv4 TOS field to effectively deal with the web traffic and prioritization issues starting from 1998.

3 0
3 years ago
Which of the following will you select as X in the following series of clicks to lay the title over a chart: Chart Title box &gt
guapka [62]

Answer:

A

Explanation:

We are to lay a title over a chart, which means the position of the title should be above the chart.

When doing this, it will centre the title over the chart without duly interfering with the original size of the chart.

The option 'over chart' is incorrect as it is not a valid selection in the pane. Below chart as well is incorrect as we are to lay the title above the chart.

3 0
3 years ago
Select the correct answer. Which character type is usually seen more often in games for young children than for the other age gr
garri49 [273]

Answer:

B. Animal

Explanation:

Just took the test on Plato

#PlatoLivesMatter

7 0
3 years ago
Other questions:
  • A ____ can interpret physical addressing information.
    11·1 answer
  • True or False, PDF documents have many benefits, but their main disadvantage is that the formatting of their text and graphic el
    15·1 answer
  • Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name
    10·1 answer
  • Your friend sees an error message during Windows startup about a corrupted bootmgr file. He has another computer with a matching
    12·1 answer
  • True or false?
    13·1 answer
  • What kind of energy transformation occurs in a gasoline-powered car?
    14·1 answer
  • Give the Division Hashing function and the index it maps the key 2000 into, assuming a primary storage area array size of 61 ele
    6·1 answer
  • Which of the following might an interior designer in the retail industry specialize in?
    9·1 answer
  • business information management professionals also perform duties of _ information system professionals
    11·1 answer
  • 8. Which of the following is an output device
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!