Question: For this assignment, you are going to be creating a more realistic Game of War. Your program should do the follow: Introduce how the game

For this assignment, you are going to be creating a more realistic "Game of War". Your program should do the follow:

  • Introduce how the game will be played
  • Play 10 rounds
    • Each round, display the card that player 1 drew, and the card player 2 drew
    • determine who won, or if it was a draw - and display that
    • Wait 2 seconds between rounds
  • At the end of each round, display the final scores, and display "XYZ won!!"

Requirements:

You must make a function called " determineWinner(winsPlayer1, winsPlayer2) that will have two parameters: winsPlayer1 , and winsPlayer2 . The user will pass as arguments the number of wins respectively that each player has. This function will determine and print the winner.

To do this in python, you'll need to use some built-in functions - namely, one that creates random numbers, and one that pauses/waits. Include the following code to do that:

import random #import the random class

import time #import the time class

and then to use the code, you will do the following:

  • to generate a random number between 0 and 10:
    • card1=random.randint(0,10)
  • to make the computer pause/wait 2 seconds:
    • time.sleep(2)

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!