Files
Tirsvad d0e6c93573
TirSystem/github-action: Sync GitHub mirror metadata / sync-metadata (push) Successful in 7s
Add project structure, license, and README for Rock Paper Scissors game
2026-10-04 10:34:29 +08:00

1.9 KiB

🚀 Rock Paper Scissors Game

A beginner-friendly Python program to play Rock, Paper, Scissors against the computer (Udemy's 100 Days of Code™: The Complete Python Pro Bootcamp, Day 4).

📚 Table of Contents

🧭 Overview

You choose 0 (Rock), 1 (Paper) or 2 (Scissors); the computer picks randomly using the random module. Both choices are shown as ASCII art, and the winner is decided with if/elif/else logic (rock beats scissors, scissors beats paper, paper beats rock). Draws and invalid input are handled.

Screenshot of the game

📋 Requirements

  • Python 3.13 or newer
  • No runtime dependencies
  • pytest for running the tests (installed via the dev extra)

🛠️ Setup

Create and activate a local virtual environment in .venv:

python -m venv .venv

Activate it:

# Windows (PowerShell)
.venv\Scripts\Activate.ps1

# Windows (cmd)
.venv\Scripts\activate.bat

# macOS / Linux / Git Bash
source .venv/bin/activate        # Git Bash on Windows: source .venv/Scripts/activate

Install the project in editable mode with test tools:

python -m pip install -e ".[dev]"

Leave the environment with deactivate.

▶️ Run

With the virtual environment active:

python -m rock_paper_scissors

or, after installing, rock-paper-scissors.

🧪 Tests

python -m pytest

📄 License

GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).