Cricket-Game

Simple Cricket Game

This is a simple cricket game implemented using HTML, CSS, and JavaScript. The game allows the player to choose between batting, bowling, or defending the wicket (stump) and then calculates the outcome based on a random choice made by the computer.

How to Play

  1. Clone or download the repository to your local machine.
  2. Open the index.html file in a web browser.
  3. You will see three buttons: "Bat", "Ball", and "Stump".
  4. Click on one of the buttons to make your choice:
    • If you choose "Bat", you're attempting to hit the ball.
    • If you choose "Ball", you're attempting to bowl.
    • If you choose "Stump", you're defending the wicket.
  5. The computer will randomly select one of the options.
  6. The result will be displayed in an alert dialog box, indicating whether you won, lost, or tied the game.

Game Rules

  • If you choose "Bat" and the computer chooses "Ball", you win.
  • If you choose "Ball" and the computer chooses "Stump", you win.
  • If you choose "Stump" and the computer chooses "Bat", you win.
  • If both you and the computer choose the same option, it's a tie.
  • Otherwise, the computer wins.

Technologies Used

  • HTML5
  • CSS3
  • JavaScript

Credits

This game was created by Vaishnavi as a simple project to practice basic web development skills.