Rock, Paper, Scissors Game (A Simple Python Task)

Link to my GitHub Repository Github Code.

Introduction

This Python application is crafted to engage users in the timeless Rock, Paper, Scissors game. Users have the flexibility to define the number of rounds they want to play. In each round, both the player and the computer choose their moves, and the outcome follows the classic game rules: Rock crushes scissors, Paper wraps around rock, and Scissors cut through paper. The game keeps track of the number of rounds won by the player and the computer, as well as the number of ties. The game ends when all specified rounds are played or when one of the players wins the majority (more than half) of the rounds. At the end of the game, the program reports the overall results, including the number of rounds won by the player and the computer, the number of ties, and declares the overall winner.

Instructions

Run the Program:

Execute the Python script rock_paper_scissors.ipynb to start the game.

Specify Number of Rounds:

The program will prompt the user to enter the number of rounds to be played. Enter a positive integer and press Enter.

Gameplay:

In each round, the player is prompted to choose between Rock, Paper, or Scissors. The computer makes its selection randomly. The winner of the round is determined based on the game rules.

End of Game:

The game ends when all specified rounds are played or when one player wins the majority of the rounds. The program then displays the final results, including the number of rounds won by the player and the computer, the number of ties, and declares the overall winner.

Implementation Details

The program is implemented using functions, lists, loops, and conditional statements in Python. The random module is used to simulate the computer’s choice in each round.