Skip to content

Latest commit

 

History

History
94 lines (62 loc) · 2.11 KB

File metadata and controls

94 lines (62 loc) · 2.11 KB

Rock-Paper-Scissors Game

This is a simple command-line implementation of the classic Rock-Paper-Scissors game in Python.

How to Play

  1. Run the script using Python.
  2. Follow the prompts to enter your choice: rock, paper, or scissors.
  3. The computer will randomly select its choice.
  4. The result of the game will be displayed along with the current statistics.
  5. You will be asked if you want to play again. Type yes to play another round or quit to stop.

Game Rules

  • Rock beats Scissors
  • Scissors beats Paper
  • Paper beats Rock
  • If both the user and the computer choose the same option, it's a tie.

Requirements

  • Python 3.x

Running the Game

To run the game, execute the following command in your terminal:

python [rpc.py](http://_vscodecontentref_/0)

Here is a `README.md` file for your rock-paper-scissors game:

```markdown
# Rock-Paper-Scissors Game

This is a simple command-line implementation of the classic Rock-Paper-Scissors game in Python.

## How to Play

1. Run the script using Python.
2. Follow the prompts to enter your choice: rock, paper, or scissors.
3. The computer will randomly select its choice.
4. The result of the game will be displayed along with the current statistics.
5. You will be asked if you want to play again. Type `yes` to play another round or `quit` to stop.

## Game Rules

- Rock beats Scissors
- Scissors beats Paper
- Paper beats Rock
- If both the user and the computer choose the same option, it's a tie.

## Requirements

- Python 3.x

## Running the Game

To run the game, execute the following command in your terminal:

```sh
python 

rpc.py

Code Structure

  • main(): The main function that runs the game loop.
  • user(): Gets the user's choice.
  • comp(): Gets the computer's random choice.
  • get_input(): Validates and returns the user's input.

Example Output

rock(1), paper(2) or scissor(3) ? 1
User: rock
Computer: paper
Computer wins!
comp_wins : 1
user_wins : 0
ties : 0
Press Enter to play again or type 'quit' to stop:

License

This project is licensed under the MIT License.


Feel free to modify the content as needed.