subject

CODE THIS IN PYTHON Ninety-Nine is a two-player card game played with a deck of 40-cards. The cards are labeled 0 – 9. To start, each player gets 3 cards and the remaining cards are placed face
down on the table (the pile). In an actual game, the point total is set to zero but for this program, an initial point total will be given. Cards are played in the order they are added to a player’s hand. Each player in turn puts down a card and changes the point total according to the point value of his card and then selects a card from the top of the pile. Each card adds its face value in points (e. g. a 5 is worth five points) to the point total except for certain cards that have special values or meanings:
1. A 9 is a pass (and does not change point total)
2. A 4 subtracts 10 points from the total
3. A 0 adds either 1 or 11 to the point total. The 11 is played first as long as it does not put
the point total over 99.
If a player plays a card that puts the total over 99, that player loses the game.
GET THE USER TO INPUT THE CARDS AND TOTAL POINT VALUE.
INPUT:

An input line will contain 11 integers. The first integer gives the initial point total. The next 3 integers will represent the 3 cards dealt to the player. The remaining integers will be, in order, the card picked by the player and the card played by the dealer.

OUTPUT:

Print the point total when the game ends and who won (player or dealer).

SAMPLE INPUT OUTPUT

87, 5, 8, 9, 7, 4, 6, 3, 9, 0, 2 101,dealer

78, 2, 4, 8, 3, 8, 5, 0, 6, 9, 8 100,dealer

95, 9, 0, 9, 0, 1, 0, 1, 0, 2, 5 100, player

65, 0, 8, 0, 7, 0, 6, 0, 5, 1, 4 105, dealer

Manual Sample run:

87, 5, 8, 9, 7, 4, 6, 3, 9, 0, 2

P P P P D P D P D P

Total = 87
Players turn 5 Total 92
Dealers turn 4 Total 82
Players turn 8 Total 90
Dealers turn 3 total 93
Players turn 9 pass total 93
Dealers turn 0 Total 94
Players turn 7 Total 101
Total 101, Dealer is the winner as the card value exceeded when player was dealing the card

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:30
What is force? what are the types of force ? explain all with suitable examples
Answers: 1
question
Computers and Technology, 22.06.2019 02:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print?
Answers: 3
question
Computers and Technology, 23.06.2019 02:30
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
question
Computers and Technology, 24.06.2019 00:50
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
You know the right answer?
CODE THIS IN PYTHON Ninety-Nine is a two-player card game played with a deck of 40-cards. The cards...
Questions
question
Mathematics, 30.11.2021 08:10
question
Mathematics, 30.11.2021 08:10
question
Engineering, 30.11.2021 08:10
Questions on the website: 13722363