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.

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
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 3 steps with 2 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

I want the program to start by prompting the user for the name of the player like it says on the instruction "under project requirements"

I tried to add it to your solution but the game will not work 

*********************Welcome to Vingt-et-un Game ! *********************
what is your name? : Joe
Hello Joe
Do You want to play Vingt-et-un againt the House? (y/n)y
1. See Rules
2. Play Game Vingt-et-un
3. Quit
Choose an option: 2
It's player turn.
Do you want to stay or roll: roll
Traceback (most recent call last):
File "/Users/Stephy/Documents/llyd
main()
.py", line 105, in <module>
File "/Users/Stephy/Documents/llyd .py", line 66, in main
playerScore += rollDice("player", True)
NameError: name 'rollDice' is not defined
Transcribed Image Text:*********************Welcome to Vingt-et-un Game ! ********************* what is your name? : Joe Hello Joe Do You want to play Vingt-et-un againt the House? (y/n)y 1. See Rules 2. Play Game Vingt-et-un 3. Quit Choose an option: 2 It's player turn. Do you want to stay or roll: roll Traceback (most recent call last): File "/Users/Stephy/Documents/llyd main() .py", line 105, in <module> File "/Users/Stephy/Documents/llyd .py", line 66, in main playerScore += rollDice("player", True) NameError: name 'rollDice' is not defined
Solution
Bartleby Expert
SEE SOLUTION
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