Write a program in Python that simulates agame of Bunco for a single player. This program will involve anumber of loops and will need to roll dice. You may include one ormore functions to organize the program’s structure. Your programdoes not need to match the structure of the output from theprovided example; however, your program must report the values froma dice roll, the score for a given roll, and must report theoverall score after each roll. The program must implement andadhere to all the rules described in the above section.

Bunco is a popular dice game where players score points by rolling a number of dice. A player has six rounds to roll three dice. The first round is round 1, the second round is round 2, the third round is round 3, etc. A round ends if a player fails to score during a roll. For our Bunco game, we will use the following scoring model. To score, the player rolls the dice. If all 3 dice match the round number, the player has rolled a “Bunco” and is awarded 21 points. If all 3 dice match, but do not match the round number, the player has rolled a “mini-Bunco” and is awarded 5 points. If the player does not roll either a Bunco or a mini-Bunco the player is awarded one point for each dice that matches the round number. If the player fails to score any points during a roll, the round ends. If the sixth round ends, the game is over. The following output is a sample of what the game might look like: Round: 1 Roll: 1 Bunco! Rolled [1, 1, 1] Scored 21 points on this roll. Total score is 21 Round: 1 Roll: 2 Rolled [5, 1, 2] Scored 1 points on this roll. Total score is 22 Round: 1 Roll: 3 Rolled [1, 5, 2] Scored 1 points on this roll. Total score is 23 Round: 1 Roll: 4 Rolled [6, 3, 6] Scored 0 points on this roll. Total score is 23 Failed to score. Round 1 over. We were unable to transcribe this imageRound: 6 Roll: 1 Mini-bunco! Rolled [3, 3, 3] Scored 5 points on this roll. Total score is 30 Round: 6 Roll: 2 Rolled [1, 5, 1] Scored 0 points on this roll. Total score is 30 Failed to score. Round 6 over. Game Over In round 1, the target value is a 1 because the round number is 1. On the first roll in round 1, the player rolled a Bunco (all dice show 1) and was awarded 21 points. Because the player scored, that player continues to roll in round 1. The player scores 1 additional point on the second roll in round 1 because the player rolled a 1 on one die and different values on the others so the round continues. This pattern is repeated on the third roll of round 1 because the player scores 1 point on the third roll. On the fourth roll of round 1, the player rolls the dice and none of the dice show a 1 (matching the round number) and all of the dice do not match each other (a mini- bunco), so the round is over. In round 2, the target value is a 2 because the round number is 2. On the first roll in round 2, the player scores 2 points because two of the dice show a 2 and the round continues because the player scored. After this roll, the player fails to score in round 2 or several of the subsequent rounds. In round 6, the target value is a 6 because the round number is 6. On the first roll of round 6, the player scores a mini-bunco because the player rolled matching values on all dice however the value does not match the round number. Because the player scored, the player rolls again in round 6. Show transcribed image text Bunco is a popular dice game where players score points by rolling a number of dice. A player has six rounds to roll three dice. The first round is round 1, the second round is round 2, the third round is round 3, etc. A round ends if a player fails to score during a roll. For our Bunco game, we will use the following scoring model. To score, the player rolls the dice. If all 3 dice match the round number, the player has rolled a “Bunco” and is awarded 21 points. If all 3 dice match, but do not match the round number, the player has rolled a “mini-Bunco” and is awarded 5 points. If the player does not roll either a Bunco or a mini-Bunco the player is awarded one point for each dice that matches the round number. If the player fails to score any points during a roll, the round ends. If the sixth round ends, the game is over. The following output is a sample of what the game might look like: Round: 1 Roll: 1 Bunco! Rolled [1, 1, 1] Scored 21 points on this roll. Total score is 21 Round: 1 Roll: 2 Rolled [5, 1, 2] Scored 1 points on this roll. Total score is 22 Round: 1 Roll: 3 Rolled [1, 5, 2] Scored 1 points on this roll. Total score is 23 Round: 1 Roll: 4 Rolled [6, 3, 6] Scored 0 points on this roll. Total score is 23 Failed to score. Round 1 over.

Round: 6 Roll: 1 Mini-bunco! Rolled [3, 3, 3] Scored 5 points on this roll. Total score is 30 Round: 6 Roll: 2 Rolled [1, 5, 1] Scored 0 points on this roll. Total score is 30 Failed to score. Round 6 over. Game Over In round 1, the target value is a 1 because the round number is 1. On the first roll in round 1, the player rolled a Bunco (all dice show 1) and was awarded 21 points. Because the player scored, that player continues to roll in round 1. The player scores 1 additional point on the second roll in round 1 because the player rolled a 1 on one die and different values on the others so the round continues. This pattern is repeated on the third roll of round 1 because the player scores 1 point on the third roll. On the fourth roll of round 1, the player rolls the dice and none of the dice show a 1 (matching the round number) and all of the dice do not match each other (a mini- bunco), so the round is over. In round 2, the target value is a 2 because the round number is 2. On the first roll in round 2, the player scores 2 points because two of the dice show a 2 and the round continues because the player scored. After this roll, the player fails to score in round 2 or several of the subsequent rounds. In round 6, the target value is a 6 because the round number is 6. On the first roll of round 6, the player scores a mini-bunco because the player rolled matching values on all dice however the value does not match the round number. Because the player scored, the player rolls again in round 6.

## Expert Answer

Answer to Write a program in Python that simulates a game of Bunco for a single player. This program will involve a number of loop…