Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need it in python fast plzzz !!!! You are to implement the basic blackjack game as outlined above. It should provide clear prompts and displays

need it in python fast plzzz
!!!!
image text in transcribed
You are to implement the basic blackjack game as outlined above. It should provide clear prompts and displays to the user along the way. These prompts should be clear enough to tell the user all they need to play the game and to determine who wins each hand. The basic flow of the game should be as follows: - Deal two cards to the user and two card to the dealer, compute the sum of the player, and display it to the user. - Ask the user if he/she wishes to HIT or STAY. - Each time the user chooses to HIT, deal him/her and the dealer a new card, update the total, and check to see if he/she or the dealer has gone bust (over the limit of 21). - Eventually, the player will choose to stay or go bust. Also, the dealer can go bust. If the player goes bust, he/she automatically loses. If the player does not go bust but the dealer goes bust, then dealer loses. If any of them goes bust, then you need to display the result, If none of them goes bust and the player choses to stay, then you need to make the decision who wins the game and display the result. - Ask the user if he or she is ready to play a new hand of blackjack. If so, your program should go to back to step 1. If not, your program should quit. Developing the solution for this program would be quite challenging without using functions. To make your job easier, think about how functions can be used to simplify the design. Your solution should have, at a minimum, the following functions: - main: the main function, which should have the main loop that repeats for each hand - get_score: handles the initial deal of two cards to the player and the dealer and the "HIT or STAY" loop for other card(sO. It should return the final player score and the dealer score. - deal_card: draw one card (i.e., one of the inner lists (e.g. ["Ace":"Heart"])) randomly (using random.choice), and process the numeric value accordingly. Remove the withdrawn card from the card deck and return the numeric card value and card deck. - set_card_deck create a card deck from an input file (cards.txt). Then, return 52 cards saved in a list of lists. You may find that additional functions are useful to modularize your design. Adding more functions when appropriate is perfectly fine! However, the four functions identified above are REQUIRED. Also, I shared a skeleton code that will help you complete this assignment. Feel free to use the skeleton code although it is not required. Also, I shared a skeleton code that will help you complete this assignment. The output produced by your program should be nearly identical to the sample output provided. While the numbers will vary because of the use of random numbers, the prompts and messages printed to the console when using your program should match those in the sample output to receive full credit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Information Quality Dimensions, Principles And Techniques

Authors: Carlo Batini, Monica Scannapieco

1st Edition

3319241060, 9783319241067

More Books

Students also viewed these Databases questions