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,...
-
A friend of yours has decided to start her own home decorating business. She has decided to establish the business as a sole proprietorship and to operate out of her home for now. Because she already...
-
Problem refer to Figures A and B. Set up definite integrals in Problem that represent the indicated shaded areas over the given intervals. Over interval [a, c] in Figure B y = f(x) y = g(x) d a y =...
-
11. What is the modified accrual basis of accounting? Which funds utilize the modified accrual basis of accounting?
-
Cornell purchased a 15-year, $25,000 bond from Fulvous Corporation for $20,000 eight years ago. Interest of $2,300 has been amortized over the eight years and added to Cornell's bond basis. In the...
-
Trinas Software Mini-Case Trina is thinking of quitting her job as a software engineer (annual salary of $75,000 per year) and starting her own programming service business. Due to her vast social...
-
Hotel DelRay is located at the heart of the city of Brussels, in Belgium. Brussels is a major hub for international politics, a home for several international organizations and diplomats, and a...
-
Sue sued Dan as a result of an automobile accident. The jury found that Sue was entitled to $100,000 as compensation for her injuries and loss of property. The jury awarded Sue $80,000. As such, the...
-
Scenario : Wanda, a BCBA, is updating an intervention plan for a leaner on her caseload to submit for insurance funding authorization. Part of the plan includes the completion of an adaptive...
-
a) how can your company accommodate generational or gender difference within your company ? b) how can your company accommodate communication and or language difference within your company ?
-
3. Consider the following data for two catalysts, A and B. The temperature is 25 C and the reaction occurs at standard conditions. a. Make a Tafel plot and determine the Tafel slope. Estimate the...
-
How consumption can be helpful in facilitating the construction of your identity? Explain the ways in which the symbolic meanings, connected with your consumption choices are important to you? Is...
-
Cataumet Boats, Inc. Jaime Giancola had just completed the first half of her MBA program and wanted to work on a project during the summer that would give her some practical experience applying what...
-
QUESTION 1 Your first assignment in your new position as an assistant financial analyst at Delalang Berhad (DLB) is to evaluate three new capital-budgeting proposals. Because this is your first...
-
Do animals have rights? If so, what are they? What duties do human beings have toward animals? Does KFC protect animal welfare at an acceptable level?
-
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...
-
10.9. Investco, a West Coast research company, must decide on the level of computer technology it will buy for its analysis department. Package A, a midlevel technology, would cost $2.5 million for...
-
10.6. Consider the cash flows associated with undertaking project X. a. Is this an early or later cash flow stream? b. Based on the term structure of interest rates in exercise 10.5, what is the...
-
10.8. ABC Metalworks wants to determine which model sheetcutter to purchase. Three choices are available, (1) machine 1 costs the least but must be replaced the most frequently, (2) machine 2 has...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App