Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkstudio585/rock-paper-scissors-python
A Python Rock, Paper, Scissors game where you compete against the computer. Input your choice, and the program displays the computer’s choice along with the result. Simple, interactive, and easy to run, this game showcases basic Python programming and game logic.
https://github.com/rkstudio585/rock-paper-scissors-python
paper program python python3 rk rk-studio rock rock-paper-scissors-python scissors scissors-rock-paper
Last synced: 6 days ago
JSON representation
A Python Rock, Paper, Scissors game where you compete against the computer. Input your choice, and the program displays the computer’s choice along with the result. Simple, interactive, and easy to run, this game showcases basic Python programming and game logic.
- Host: GitHub
- URL: https://github.com/rkstudio585/rock-paper-scissors-python
- Owner: rkstudio585
- Created: 2024-09-01T06:14:11.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-01T06:19:05.000Z (4 months ago)
- Last Synced: 2024-11-07T16:16:20.093Z (about 2 months ago)
- Topics: paper, program, python, python3, rk, rk-studio, rock, rock-paper-scissors-python, scissors, scissors-rock-paper
- Language: Python
- Homepage: https://github.com/mdriyadkhan585
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rock, Paper, Scissors Game 🪨📄✂️
---
[In C Script](https://github.com/mdriyadkhan585/rock-paper-scissors-C)![Logo](logo.svg)
---
Welcome to the Python version of the Rock, Paper, Scissors game! This command-line game allows you to challenge the computer in a classic game of Rock, Paper, Scissors. Play to see who wins!## Table of Contents 📚
1. [Introduction](#introduction)
2. [Features](#features)
3. [How to Run](#how-to-run)
4. [Gameplay Instructions](#gameplay-instructions)
5. [Code Explanation](#code-explanation)## Introduction
This project is a straightforward implementation of the Rock, Paper, Scissors game in Python. It demonstrates basic concepts like user input handling, random choice generation, and simple game logic.
## Features 🌟
- Play Rock, Paper, Scissors against the computer 🤖
- Clear and informative output 💬
- Randomized computer choices 🎲
- Easy to run and understand code 🧩## How to Run 🚀
1. **Clone the Repository:**
```bash
git clone https://github.com/mdriyadkhan585/rock-paper-scissors-python.git
```2. **Navigate to the Project Directory:**
```bash
cd rock-paper-scissors-python
```3. **Run the Program:**
Make sure you have Python installed, then execute:
```bash
python rock_paper_scissors.py
```## Gameplay Instructions 🎮
1. **Start the Game:**
After running the program, you’ll be prompted to enter your choice.2. **Enter Your Choice:**
- Type `Rock` 🪨
- Type `Paper` 📄
- Type `Scissors` ✂️3. **View the Results:**
The program will display the computer's choice and the result of the game (win, lose, or tie).4. **Play Again:**
You can run the program again to play another round.## Code Explanation 🛠️
1. **Getting the Computer's Choice:**
```python
def get_computer_choice():
return random.choice(['Rock', 'Paper', 'Scissors'])
```
- Uses the `random.choice` function to select a random choice for the computer.2. **Determining the Winner:**
```python
def determine_winner(player_choice, computer_choice):
# Compares choices and prints the result
```
- Compares player and computer choices and prints whether the player won, lost, or tied.3. **User Input and Validation:**
```python
player_choice = input("Your choice: ").capitalize()
```
- Prompts the user to enter their choice and capitalizes the input to match the expected format.4. **Formatted Output:**
- Displays user and computer choices, and announces the result in a clear and engaging format.---