create a function solo_game() that runs a game of Twenty One for one user against a computer player. It should create two player objects, one for the user and one computer player. As well as a...


create a function solo_game() that runs a game of Twenty One for one user against a computer player.







It should create two player objects, one for the user and one computer player. As well as a variable to track rounds, starting with 0.







The game loop should be a while loop where each iteration represents a round, and the loop must only terminate if the game is over.







During the start of each round the round statistics must be printed.







The user plays first followed by the computer player. The loop must only consider each player's turn if they are not bust and haven't stayed, else skipping their turn. During each player's turn, the function should call display_game_options(player) before getting the player's move.







During the user's turn, you can use int_input() with the valid set of options as per if the score is >= 14.







For the computer player's turn, call the function cpu_player_choice(score) with the CPU player's score to receive an integer as a choice.







Upon receiving input, you can update the player object with the following:


player = execute_turn(player, player_input)







Finally at the end of each round, call the function end_of_game(players) where players = [player, cpu_player] and exit loop if the result is true, otherwise incrementing the round count by one.



Aug 24, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here