Question: This exercise is to simulate 2 0 0 0 0 0 rounds of a dice version of the children's card game War. The purpose of

This exercise is to simulate 200000 rounds of a dice version of the children's card game War. The purpose of this simulation is to determine which player has an advantage of based on these rules below.
Rules
There are two players: PLAYER and BANKER. These are just names for the players. Each player has a regular six-sided die. In one round, each player will roll their die and attempt to get the highest value. The rules are:
If either player rolls a six, the game stops. The player with the higher die value wins. If both dice values are the same, then it is a tie.
If neither player has a six in the initial roll, then a player may re-roll under these conditions:
If the BANKER initially rolled a 3 or below, the BANKER will re-roll their die.
If the PLAYER initially rolled a 2 or below, the PLAYER will re-roll their die.
After this reroll, the game stops. The player with the higher die value wins. If both dice values are the same, then it is a tie.
Tasks
The starter code has been created for you. You must use it with the two functions you will write, especially the outcomes dictionary variable declared for you.
Complete the simulateGames function. Simulate the total number of rounds with the rules. Determine the outcome and increase the count on the outcomes dictionary. Use the rollDie function included for you for this task.
Complete the visualizeResults function. Use the seaborn barplot() to visualize the outcomes.
Function comments have been added for you.
Answer the questions below.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!