Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need it in python plzzz without the break statement You are to implement the basic blackjack game as outlined above. It should provide clear prompts
need it in python plzzz
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. Satisfying all basic requirements perfectly, with no points deducted for any reason, would earn a maximum score of 150 out of 150 for without the break statement
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started