Write a PYTHON Program for the following information related to a game: The game consists of two
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a PYTHON Program for the following information related to a game:
Transcribed Image Text:
The game consists of two players taking alternating turns until one player has scored 100 points, at which time the game is over. Each turn starts with the player making the choice to play or hold. . If they play, the program generates a random number from 1 to 6 inclusive. The result is examined. o If the result is a 1, the player scores no points, and their turn is over. o If the result is any other number, the player adds the number to the player's turn total. If they hold, their turn points are added to their score, and it becomes the opponent's turn. Pay particular attention to making sure variables are reset at the beginning of each turn. You need to have print statements to let the player know the following information. These are needed every time a player needs to make a decision. Player l's score Player 2's score . The current turn total The game consists of two players taking alternating turns until one player has scored 100 points, at which time the game is over. Each turn starts with the player making the choice to play or hold. . If they play, the program generates a random number from 1 to 6 inclusive. The result is examined. o If the result is a 1, the player scores no points, and their turn is over. o If the result is any other number, the player adds the number to the player's turn total. If they hold, their turn points are added to their score, and it becomes the opponent's turn. Pay particular attention to making sure variables are reset at the beginning of each turn. You need to have print statements to let the player know the following information. These are needed every time a player needs to make a decision. Player l's score Player 2's score . The current turn total
Expert Answer:
Answer rating: 100% (QA)
import random def rolldice return randomrandint1 6 def main playerscores 0 0 c... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
5. Unemployment insurance and permanent job loss. Workers sometimes lose their jobs due to international trade. These jobs are permanently gone, and many displaced workers have difficulty finding a...
-
Background You have been asked to develop the logic for a version of a card game that has aspects similar to the popular card game Uno. The working title for the game is Quattro (as it has four...
-
Create the game: Mancala Setup Players sit on either side of the board. Each player has six bowlsand one mancala. Before play begins, four stones are placed intoeach bowl, while both mancalas are...
-
? Fisheries Bhd is a small listed company involves in fishing and selling fish to the public via retail outlets. The company owns a building that was acquired in early September 2014 for RM1,200,000,...
-
Reduction of 2-butanone with NaBH4 yields 2-butanol. Is the product chiral is it optically active? Explain.
-
(a) Determine whether the polynomials x2 + 1, x2 - 1, x2 + x + I span P(2). (b) Do x3 - I, x2 + 1, x - 1, 1 span P(3)? (c) What about x3, x2 + 1, x2 - x, x + 1?
-
Rank the magnet pairs in Figure P27.15 in order of the magnitude of torque on magnet 2 , smallest torque first. Assume all the magnets are equal in strength and the spacing between magnets is...
-
Rees Corporation experienced a fire on December 31, 2011, in which its financial records were partially destroyed. It has been able to salvage some of the records and has ascertained the following...
-
19.A radioactive -emission. A detector records n -particles in 2s and by next 2s (accumulatively) it records 1.1 n -particle. Number of -particles recorded by detector after a long time, is (1) 11n...
-
The micrometer (1m) is often called the micron. (a) How many microns make up 1.0 km? (b) What fraction of a centimeter equals 1.0m? (c) How many microns are in 1.0 yd?
-
For n = 12, determine whether the number of partitions of n into parts each of which appears at most 4 times, is equal to the number of partitions of n into parts the sizes of which are not divisible...
-
How can online PR help to promote a new product?
-
Name, and briefly explain, four characteristics of an online service that will govern whether a user recommends it.
-
Suggest three measures a company can take to ensure that a customers privacy is not infringed when conducting one-to-one marketing.
-
Explain two applications of dynamic pricing on the Internet.
-
How can different forms of customer insight be used to inform campaign execution?
-
S = 70 The cross section of the rim of an iron flywheel (S+3)ft. In diameter is a rectangle 12" by 3". How much does the rim weigh? Note: Iron weighs 450lb/cu.ft. * ---12--
-
Eleni Cabinet Company sold 2,200 cabinets during 2011 at $160 per cabinet. Its beginning inventory on January 1 was 130 cabinets at $56. Purchases made during the year were as follows: February . 225...
-
Assume the same scenario as BE7-5 but the company chooses to use hedge accounting. What would be reflected on the financial statements at January 15, 2013, regarding this transaction?
-
Endeavour Films is a production company that produces movies and television shows. It also owns cable television systems that broadcast its movies and television shows. Endeavour transferred to Barco...
-
TC Corp. appointed a candidate as its new CEO under a 10-year contract. The contract required TC to pay the candidate $5 million if TC is acquired before the contract expires. AC Ltd. acquires TC...
-
Select an information system with which you are familiar, and which you feel needs to be improved, based upon your experiences as an employee, customer, other system user, or system owner, Switch...
-
You have learned the importance of making sure that requirements are correctly identified. Hut how do you know when you have a correct requirement-that is, what criteria must each requirement meet in...
-
Prepare a full feasibility analysis, including Economic, Operational, Schedule, Legal, and Technical analyses for the system you are suggesting in problem 1. Your analysis should be no more than 30...
Study smarter with the SolutionInn App