Vingt-et-un vingtEtUn.py Vingt-et-un is a dice game (known as Blackjack in the USA), where a player competes against the computer (house). The goal of the game is to score 21 points, or as near as possible without going over. The two players take turns throwing two dies as many times as desired and adding up the numbers thrown on each round. A player who totals over 21 is bust and loses the game. → The player whose total is nearest 21, after each player has had a turn, wins the game. In the case of an equality high total, the game is tied. The game is over at the end of a round when: One or both players are bust. Both players choose to stay. Notes > Once a player totals 14 or more, one of the dies is discarder for the consecutive turns. The house must throw the dice until the total is 17 or higher. At 17 or higher, the house must stay. Project Requirements The program will start by prompting the user for the name of the player. The game will be implemented using a menu-driven interface that provides the following options: 1. See the Rules. 2. Play Vingt-et-un. 3. Quit. If the user chooses 1 from the menu, display the rules of the game. If the user chooses 2 from the menu Go into a loop of rounds where player & house will take turns throwing the dice. At each turn the system will ask the player/house whether to stay or roll. If the house has a running total of 17 or higher, it stays, and the turn passes to the player. → If the player/house option is to roll, the program simulates the roll of the two dies and updates. & displays the player's running total.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question

Using Python, make a dice game with the following instructions .

Thank you very much

Vingt-et-un
✪ vingtEtUn.py
Vingt-et-un is a dice game (known as Blackjack in the USA), where a player competes against the
computer (house).
The goal of the game is to score 21 points, or as near as possible without going over. The two players
take turns throwing two dies as many times as desired and adding up the numbers thrown on each
round.
ⒸA player who totals over 21 is bust and loses the game.
→ The player whose total is nearest 21, after each player has had a turn, wins the game.
→ In the case of an equality high total, the game is tied.
The game is over at the end of a round when:
Ⓒ One or both players are bust.
Ⓒ Both players choose to stay.
Notes
→ Once a player totals 14 or more, one of the dies is discarder for the consecutive turns.
The house must throw the dice until the total is 17 or higher. At 17 or higher, the house must
stay.
Project Requirements
The program will start by prompting the user for the name of the player.
The game will be implemented using a menu-driven interface that provides the following options:
1. See the Rules.
2. Play Vingt-et-un.
3. Quit.
If the user chooses 1 from the menu, display the rules of the game.
If the user chooses 2 from the menu
Go into a loop of rounds where player & house will take turns throwing the dice.
At each turn the system will ask the player/house whether to stay or roll.
→ If the house has a running total of 17 or higher, it stays, and the turn passes to the player.
→ If the player/house option is to roll, the program simulates the roll of the two dies and updates
& displays the player's running total.
Transcribed Image Text:Vingt-et-un ✪ vingtEtUn.py Vingt-et-un is a dice game (known as Blackjack in the USA), where a player competes against the computer (house). The goal of the game is to score 21 points, or as near as possible without going over. The two players take turns throwing two dies as many times as desired and adding up the numbers thrown on each round. ⒸA player who totals over 21 is bust and loses the game. → The player whose total is nearest 21, after each player has had a turn, wins the game. → In the case of an equality high total, the game is tied. The game is over at the end of a round when: Ⓒ One or both players are bust. Ⓒ Both players choose to stay. Notes → Once a player totals 14 or more, one of the dies is discarder for the consecutive turns. The house must throw the dice until the total is 17 or higher. At 17 or higher, the house must stay. Project Requirements The program will start by prompting the user for the name of the player. The game will be implemented using a menu-driven interface that provides the following options: 1. See the Rules. 2. Play Vingt-et-un. 3. Quit. If the user chooses 1 from the menu, display the rules of the game. If the user chooses 2 from the menu Go into a loop of rounds where player & house will take turns throwing the dice. At each turn the system will ask the player/house whether to stay or roll. → If the house has a running total of 17 or higher, it stays, and the turn passes to the player. → If the player/house option is to roll, the program simulates the roll of the two dies and updates & displays the player's running total.
→ If the player/house starts the round with an accumulated total of 14 points or more, only one
die will be rolled.
Once the game is over the system will display the result
Winner
Loser
Tie
If the user chooses 3 from the menu, display a good-bye message and quit.
The users can play the game as many times as they wish until they choose 3 to Quit.
Notes about Functionality, Implementation & Program Requirements
1. The code should be self-documented, including:
→ Descriptive program documentation indicating
→ - Author
Ⓒ - Program Summary
Ⓒ-IPO Chart
Appropriate comments throughout the code that highlight, among other things, the
implementation of the algorithm.
2. Input Validation:
→ Validate that all menu choices & user answers are valid.
3. Functional decomposition implementation of the algorithm.
→ Must define at least three different functions (besides main()).
→ Make sure to include functions that exemplify returning of values & parameter passing.
Transcribed Image Text:→ If the player/house starts the round with an accumulated total of 14 points or more, only one die will be rolled. Once the game is over the system will display the result Winner Loser Tie If the user chooses 3 from the menu, display a good-bye message and quit. The users can play the game as many times as they wish until they choose 3 to Quit. Notes about Functionality, Implementation & Program Requirements 1. The code should be self-documented, including: → Descriptive program documentation indicating → - Author Ⓒ - Program Summary Ⓒ-IPO Chart Appropriate comments throughout the code that highlight, among other things, the implementation of the algorithm. 2. Input Validation: → Validate that all menu choices & user answers are valid. 3. Functional decomposition implementation of the algorithm. → Must define at least three different functions (besides main()). → Make sure to include functions that exemplify returning of values & parameter passing.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole