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
The common field cricket chirps in direct proportion to the current tem­perature. Adding 40 to the number of times a cricket chi
Luda [366]

Answer:

chirps = int(input("Enter the number of cricket chirps in fifteen seconds: "))

temperature = chirps + 40

print("The temperature is: " + str(temperature))

Explanation:

*The code is in Python.

Ask the user to enter the number of cricket chirps in fifteen seconds

Use the given formula to calculate the temperature (Note that since the user enters the number of cricket chirps in fifteen seconds, I did not divide the sum by 4)

Print the temperature

8 0
4 years ago
2.1. The stream cipher described in Definition 2.1.1 can easily be generalized to work in alphabets other than the binary one. F
nekit [7.7K]

Answer:

See attached image

Explanation:

7 0
3 years ago
Consider that an individual threat agent, like a hacker, can be a factor in more than one threat category. If a hacker breaks in
pogonyaev
I think the answer is 5 categories but I am not sure
7 0
3 years ago
What is the maximum transmission speed for bluetooth v3 and v4 devices?
kvv77 [185]
Bluetooth v3 and v4 devices<span> have a </span>maximum transmission speed<span> of up to 24 Mbps.</span>
6 0
3 years ago
______ provide visual representations of the options available for a given command
anygoal [31]

The visual representations is provided by the Gallery in the computer system.

Basically, gallery means the collection of pictures in a Computer.

  • Gallery is what enables systematic display and the management of distinct images in the computer.

  • A very good illustration is use of Clipart images. It is a ready made picture gallery available in the computer.

  • Every function on computer are represented with an icon, the icon images are enable through the Gallery.

In conclusion, the Visual representations of the options available for a given command is provided by the Gallery.

Read more about Gallery here

<em>brainly.com/question/2946480</em>

5 0
3 years ago
Other questions:
  • Su wants to apply the new font to the other slides of the presentation. She knows she can use the Format Painter tool
    12·1 answer
  • A company that manufactures machine parts order a new system that makes Products at ten times the speed of earlier machines. the
    13·2 answers
  • Consolidating a system's physical and time resources is known as ________________.
    13·1 answer
  • When starting a new job, the form you complete to determine how much tax to withhold from your paycheck is called the
    9·1 answer
  • To prevent injury when pulling a nail be sure the material holding the nail is
    14·1 answer
  • The problem with the media giving equal air time to those who are __________ about the effects of media violence on violent beha
    9·1 answer
  • An internal control system is used to do all of the following: (You may select more than one answer. Single click the box with t
    11·1 answer
  • After inserting a video into your slide how can you test it
    11·1 answer
  • What equipment allows a computer to connect to the internet.
    13·1 answer
  • What is a program answer these question<br>of grade-6​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!