START OF PLAY The player starts with 100 points. They have ten attempts (or rounds) to reach 500 points to win. Each round, the player "bets" some amount of points. See gameplay as follows: A HIGH/LOW ROUND (1) The player is shown an initial random card. Cards have a value from 2-14; however, these values are converted to a string as follows: 2-9 are converted to their string equivalent "2", "3", ..."9" 10 is "T", 11 is "J", 12 is "Q", 13 is "K" and 14 is "A" (2) After the play sees the first card, they should guess if the next card will be higher (i.e., greater than the current card) or lower (i.e., a lower value than the first card). They will do this by inputting "H" or "L" (lowercase "h" and "I" will also be accepted as valid input). (3) After they input their "high" or "low" guess, the player bets a number of points that their guess will be right. The bet must be between 1 and the total amount of points the player has. (4) After the bet amount is entered, a second card will be randomly generated. If the player was right about their guess (high or low) they win the bet amount; otherwise, they lose the amount the bet amount. The bet amount will be added or deducted from their overall points. Question: What if the second card is the same value as the first? You still lose because it isn't higher or lower. (5) The game keeps going until the player points go to 0 (i.e., they lose all their points) or the player wins 500 points or more. If the player cannot get to 500 points within ten (10) rounds, they also lose. STOPPING CRITERIA (1) [WIN] If the player reaches 500 or more points, stop and let them know how many rounds it took them. (2) [LOSE] If the player runs out of points (i.e., points is 0), stop the game and let them know what round they ran out of points. (3) [LOSE] If they have not reached 500 or more points after ten rounds, let them know the final number of points they have and that they made it to 10 rounds.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Please help me to code this Python 
It is High/Low Card Game

 

The pyex is example of output

-- Welcome to High-Low -
Start with 18e points. Each round a card will be drawn and shown.
Select whether you think the 2nd card will be Higher or Lower than the ist card.
Then enter the anount you want to bet.
If you are right, you win the anount you bet, otherwise you lose.
Try to make it to see polnts within 1e tries.
OVERALL POINTS: 100 ROUND 1/18
First card is a [8]
Ensure that the user inputs either "H",
"h", L", or 1".
High or Low (H/L)?: 3
or Low (H/L)?: K
High or Low (H/L)?: L
Input bet anount: se
Second card is a [7]
Cardi [8] Card 2 [7j - You bet 'LOM for 5e - YOU MON
OVERALL POINTS: 158 ROUND 2/18
First card is a [K]
High or Low (H/L)?: 1
Input bet anount: e
Ensure that the best amount is
between 1 and maximum overall
points. You can assume the input will
be an integer.
Input bet aount: -1
Input bet anount: 180
Input bet anount: 150
Second card is a [5]
Cardi [K] Card 2 [5] - You bet 'LOM' for 1se - YOU WON
OVERALL POINTS: 300 ROUND 3/18
First card is a p)
High or Low (H/Lj?: 1
Input bet anount: 1
Second card is a [9]
Cardi [P] Card 2 (9) - Vou bet 'LOM for 1- voU MON
OVERALL POINTS: 301 ROUND 4/18
First card is a [9]
High or Lou (H/Lj?: 1
Input bet amount: 2
Second card is a [S)
Cardi (9] Card 2 [5] - Vou bet 'LOM for 2 - YoU MON
OVERALL POINTS: ROUND 5/18
First card is a [K]
High or Low (H/L)?: h
Input bet amount: 280
Second card is a [9]
Cardi [K] Card2 (9] - You bet HIGH for 200- VOU LOST
OVERALL POINTS: 103 ROLND 6/10
First card is a (3]
High or Low (H/L)j?: 1
Input bet amount: 48
Second card is a [3)
Cardi [3] Card2 (3]- Vou bet 'LOM for e - YOU LOST
Page 5/7
OVERALL POINTS: 63 ROUND 7/10
First card is a [7]
High or Low (H/L)?: h
Input bet anount: 10
Second card is a [5]
Cardi [7] Card2 (š] - You bet 'HIGH' for 1e - YOU LOST
OVERALL POINTS: 53 ROUND 8/1e
First card is a [5]
High or Low (H/L)?: h
Input bet anounti 10
Second card is a [5]
Cardi [5] Card2 (5]- You bet HIGH for 10 - YOU LOST
OVERALL POINTS: 43 ROUND 9/10
First card is a (6]
High or Low (H/L)Pi 1
Input bet amount: 28
Second card is a [3]
Cardi [6] Card 2 13j - You bet 'LOM for 28 - YOU MON
OVERALL POINTS: 63 ROUND 18/18
First card is a [9]
High or Low (H/L)P: h
Input bet anount: 60
Second card is a (6]
Cardi (9] Card2 (6] - You bet 'HIGH' for 6e - YOU LOST
LOSE .
ONLY 3* POINTS IN 10 ROUNDS!
In this case, we have made it to 10
rounds but still have not reached 500
points. Let the player know they lost
...
Transcribed Image Text:-- Welcome to High-Low - Start with 18e points. Each round a card will be drawn and shown. Select whether you think the 2nd card will be Higher or Lower than the ist card. Then enter the anount you want to bet. If you are right, you win the anount you bet, otherwise you lose. Try to make it to see polnts within 1e tries. OVERALL POINTS: 100 ROUND 1/18 First card is a [8] Ensure that the user inputs either "H", "h", L", or 1". High or Low (H/L)?: 3 or Low (H/L)?: K High or Low (H/L)?: L Input bet anount: se Second card is a [7] Cardi [8] Card 2 [7j - You bet 'LOM for 5e - YOU MON OVERALL POINTS: 158 ROUND 2/18 First card is a [K] High or Low (H/L)?: 1 Input bet anount: e Ensure that the best amount is between 1 and maximum overall points. You can assume the input will be an integer. Input bet aount: -1 Input bet anount: 180 Input bet anount: 150 Second card is a [5] Cardi [K] Card 2 [5] - You bet 'LOM' for 1se - YOU WON OVERALL POINTS: 300 ROUND 3/18 First card is a p) High or Low (H/Lj?: 1 Input bet anount: 1 Second card is a [9] Cardi [P] Card 2 (9) - Vou bet 'LOM for 1- voU MON OVERALL POINTS: 301 ROUND 4/18 First card is a [9] High or Lou (H/Lj?: 1 Input bet amount: 2 Second card is a [S) Cardi (9] Card 2 [5] - Vou bet 'LOM for 2 - YoU MON OVERALL POINTS: ROUND 5/18 First card is a [K] High or Low (H/L)?: h Input bet amount: 280 Second card is a [9] Cardi [K] Card2 (9] - You bet HIGH for 200- VOU LOST OVERALL POINTS: 103 ROLND 6/10 First card is a (3] High or Low (H/L)j?: 1 Input bet amount: 48 Second card is a [3) Cardi [3] Card2 (3]- Vou bet 'LOM for e - YOU LOST Page 5/7 OVERALL POINTS: 63 ROUND 7/10 First card is a [7] High or Low (H/L)?: h Input bet anount: 10 Second card is a [5] Cardi [7] Card2 (š] - You bet 'HIGH' for 1e - YOU LOST OVERALL POINTS: 53 ROUND 8/1e First card is a [5] High or Low (H/L)?: h Input bet anounti 10 Second card is a [5] Cardi [5] Card2 (5]- You bet HIGH for 10 - YOU LOST OVERALL POINTS: 43 ROUND 9/10 First card is a (6] High or Low (H/L)Pi 1 Input bet amount: 28 Second card is a [3] Cardi [6] Card 2 13j - You bet 'LOM for 28 - YOU MON OVERALL POINTS: 63 ROUND 18/18 First card is a [9] High or Low (H/L)P: h Input bet anount: 60 Second card is a (6] Cardi (9] Card2 (6] - You bet 'HIGH' for 6e - YOU LOST LOSE . ONLY 3* POINTS IN 10 ROUNDS! In this case, we have made it to 10 rounds but still have not reached 500 points. Let the player know they lost ...
START OF PLAY
The player starts with 100 points. They have ten attempts (or rounds) to reach 500 points to win. Each
round, the player "bets" some amount of points. See gameplay as follows:
A HIGH/LOW ROUND
(1) The player is shown an initial random card.
Cards have a value from 2-14; however, these values are converted to a string as follows:
2-9 are converted to their string equivalent "2", "3", ... "9"
10 is "T", 11 is "J", 12 is "Q", 13 is "K" and 14 is "A"
(2) After the play sees the first card, they should guess if the next card will be higher (i.e., greater than the
current card) or lower (i.e., a lower value than the first card).
They will do this by inputting "H" or "L" (lowercase "h" and "I" will also be accepted as valid input).
(3) After they input their "high" or "low" guess, the player bets a number of points that their guess will be
right. The bet must be between 1 and the total amount of points the player has.
(4) After the bet amount is entered, a second card will be randomly generated. If the player was right about
their guess (high or low) they win the bet amount; otherwise, they lose the amount the bet amount.
The bet amount will be added or deducted from their overall points.
Question: What if the second card is the same value as the first? You still lose because it isn't higher or lower.
(5) The game keeps going until the player points go to 0 (i.e., they lose all their points) or the player wins 500
points or more. If the player cannot get to 500 points within ten (10) rounds, they also lose.
STOPPING CRITERIA
(1) [WIN] If the player reaches 500 or more points, stop and let them know how many rounds it took them.
(2) [LOSE] If the player runs out of points (i.e., points is 0), stop the game and let them know what round they
ran out of points.
(3) [LOSE] If they have not reached 500 or more points after ten rounds, let them know the final number of
points they have and that they made it to 10 rounds.
Transcribed Image Text:START OF PLAY The player starts with 100 points. They have ten attempts (or rounds) to reach 500 points to win. Each round, the player "bets" some amount of points. See gameplay as follows: A HIGH/LOW ROUND (1) The player is shown an initial random card. Cards have a value from 2-14; however, these values are converted to a string as follows: 2-9 are converted to their string equivalent "2", "3", ... "9" 10 is "T", 11 is "J", 12 is "Q", 13 is "K" and 14 is "A" (2) After the play sees the first card, they should guess if the next card will be higher (i.e., greater than the current card) or lower (i.e., a lower value than the first card). They will do this by inputting "H" or "L" (lowercase "h" and "I" will also be accepted as valid input). (3) After they input their "high" or "low" guess, the player bets a number of points that their guess will be right. The bet must be between 1 and the total amount of points the player has. (4) After the bet amount is entered, a second card will be randomly generated. If the player was right about their guess (high or low) they win the bet amount; otherwise, they lose the amount the bet amount. The bet amount will be added or deducted from their overall points. Question: What if the second card is the same value as the first? You still lose because it isn't higher or lower. (5) The game keeps going until the player points go to 0 (i.e., they lose all their points) or the player wins 500 points or more. If the player cannot get to 500 points within ten (10) rounds, they also lose. STOPPING CRITERIA (1) [WIN] If the player reaches 500 or more points, stop and let them know how many rounds it took them. (2) [LOSE] If the player runs out of points (i.e., points is 0), stop the game and let them know what round they ran out of points. (3) [LOSE] If they have not reached 500 or more points after ten rounds, let them know the final number of points they have and that they made it to 10 rounds.
Expert Solution
steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY