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
Assume your friend just sent you 32 bits of pixel data (just the 0s and 1s for black and white pixels) that were encoded after s
lara31 [8.8K]

Answer:

your friend just sent you 32 bits of pixel data (just the 0s and 1s for black and white pixels) that were encoded after sampling an image. Choose the two statements that are true.

------------------

The 32 bits of pixel data is enough to produce the image using the widget. Nothing else is needed.

------------------------

The digital image would be an exact copy of the analog image.

-----------------------------The correct width and height must be input into the pixelation widget to produce the image.

---------------------------The fact that only 32 bits were used to represent the image indicates relatively large sample squares were used. The digital image may vary from the analog image significantly

Explanation:

3 0
3 years ago
WILL GIVE BRAINLYIEST 3pts) Make a prediction about which material will be the best insulator and conductor of heat. Materials:
sesenic [268]

Answer:

a. I think the <u>Aluminum</u> will conduct heat better.

b. I think the <u>Fiberglass</u> will insulate heat better.

Fiberglass is used to insulate most everyday items, so I can be sure that fiberglass can be the best insulator, as for aluminum it conducts heat like you wouldn't believe.

Note: Your answer doesn't have to be right, they just want you to make a prediction about your answer, that means it's alright to guess, also know I didn't guess I am just telling you that you didn't have to ask this question. <3

6 0
3 years ago
What is a problem (worldwide or personal) that was solved by social media?
Zanzabum
You could write about any natural disaster, in which through social media they were able to raise funds to help those affected by said disaster
3 0
2 years ago
Write and execute a query that will determine the average number of days that automobiles are rented. Show your result broken ou
denpristay [2]

Using the knowledge in computational language in SQL it is possible to write a code that query that will determine the average number of days that automobiles are rented

<h3>Writting in SQL:</h3>

<em>select Customer.CID,CName,Age,Resid_City,BirthPlace,</em>

<em>Rentcost.Make,Cost,Rentals.Rtn,Date_Out,Pickup,Date_returned,Return_city</em>

<em>from Customer,Rentcost,Rentals where</em>

<em>Customer.CID=Rentals.CID and Rentcost.Make=Rentals.Make</em>

<em>order by Customer.CID, Rentcost.Make asc;</em>

<em />

<em>select Customer.CID,CName from Customer,Rentals where Customer.CID=Rentals.CID</em>

<em>and Pickup='Cary';</em>

<em />

<em>select distinct(CName),age from Customer,Rentals where Customer.CID=Rentals.CID</em>

<em>and Return_city='Erie' order by CName asc;</em>

<em />

<em>select Customer.CID,CName from Customer,Rentals where Customer.CID=Rentals.CID</em>

<em>and Return_city is null;</em>

<em />

<em>select CName from Customer,Rentals where Customer.CID=Rentals.CID</em>

<em>and Resid_City=Pickup;</em>

See more about SQL at brainly.com/question/13068613

#SPJ1

7 0
2 years ago
the grade point average collected from a random sample of 150 students. assume that the population standard deviation is 0.78. f
salantis [7]

Answer:

E =  14.81\%

Explanation:

Given

n = 150

\sigma = 0.78

c = 0.98

Required

The margin of error (E)

This is calculated as:

E = z * \frac{\sigma}{\sqrt{n}}

When confidence level = 0.98 i.e. 98%

The z score is: 2.326

So, we have:

E = 2.326 * \frac{0.78}{\sqrt{150}}

E = 2.326 * \frac{0.78}{12.247}

E =  \frac{2.326 *0.78}{12.247}

E =  \frac{1.81428}{12.247}

E =  0.1481

Express as percentage

E =  14.81\%

3 0
3 years ago
Other questions:
  • What obstacles could prevent you from getting and keeping a job
    5·1 answer
  • What type of elements are bridges exposed to yearly
    13·2 answers
  • Writenames of eight output device.​
    8·1 answer
  • Which of the following is a unique feature of Object-oriented programming?
    6·2 answers
  • Which of the following is a school-to-work program that provides the student with paid employment, school credit, and school gra
    7·2 answers
  • Which of these image sizes takes the most storage space?
    8·2 answers
  • Where (what memory location) is the data read from for the following code:
    12·1 answer
  • If you type =5*3 into a cell, what do you expect the answer will be?
    11·2 answers
  • It takes Mike 18 minutes to finish reading 4 pages of a book. How long would it take for him to finish 30 pages ?​
    9·1 answer
  • What are some preferences you can set in photoshop?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!