{"id":26737491,"url":"https://github.com/fahadelahikhan/rock-paper-scissors-python","last_synced_at":"2025-03-28T02:51:07.303Z","repository":{"id":254875451,"uuid":"847819235","full_name":"fahadelahikhan/Rock-Paper-Scissors-Python","owner":"fahadelahikhan","description":"A simple Python script to play the classic Rock-Paper-Scissors game. Test your luck and challenge the computer!","archived":false,"fork":false,"pushed_at":"2025-03-13T09:33:46.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T10:32:09.654Z","etag":null,"topics":["beginner-project","command-line-game","game","interactive-game","programming-practice","python","python-script","python3","rock-paper-scissors","simple-game"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fahadelahikhan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-26T15:53:57.000Z","updated_at":"2025-03-13T09:33:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"74dbdd55-6daf-46a7-af84-9e0310b9fc74","html_url":"https://github.com/fahadelahikhan/Rock-Paper-Scissors-Python","commit_stats":null,"previous_names":["fahadelahikhan/rock-paper-scissors-python"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadelahikhan%2FRock-Paper-Scissors-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadelahikhan%2FRock-Paper-Scissors-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadelahikhan%2FRock-Paper-Scissors-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fahadelahikhan%2FRock-Paper-Scissors-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fahadelahikhan","download_url":"https://codeload.github.com/fahadelahikhan/Rock-Paper-Scissors-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245960690,"owners_count":20700780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beginner-project","command-line-game","game","interactive-game","programming-practice","python","python-script","python3","rock-paper-scissors","simple-game"],"created_at":"2025-03-28T02:51:06.426Z","updated_at":"2025-03-28T02:51:07.293Z","avatar_url":"https://github.com/fahadelahikhan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rock-Paper-Scissors Python 🪨📄✂️\r\n\r\n![Python Version](https://img.shields.io/badge/python-3.8%2B-blue)\r\n![License](https://img.shields.io/badge/license-MIT-green)\r\n\r\nA simple command-line implementation of the classic Rock-Paper-Scissors game in Python.\r\n\r\n## 📜 About\r\nThis project implements the traditional Rock-Paper-Scissors game where players compete against a computer opponent. The game follows standard rules where rock beats scissors, scissors beat paper, and paper beats rock. It's an excellent example of basic game logic and user input handling in Python.\r\n\r\n## ✨ Features\r\n- Classic Rock-Paper-Scissors gameplay\r\n- Random computer opponent selection\r\n- Simple command-line interface\r\n- Input validation for user choices\r\n- Clear win/lose/draw conditions\r\n\r\n## 🚀 Quick Start\r\n\r\n### Installation\r\n1. Clone the repository:\r\n   ```bash\r\n   git clone https://github.com/fahadelahikhan/Rock-Paper-Scissors-Python.git\r\n   cd Rock-Paper-Scissors-Python\r\n   ```\r\n\r\n2. Run the game:\r\n   ```bash\r\n   python \"Rock Paper Scissors.py\"\r\n   ```\r\n\r\n### Basic Usage\r\n```python\r\n# Import the game function\r\nfrom rock_paper_scissors import play_game\r\n\r\n# Start a new game\r\nplay_game()\r\n\r\n# Choose your move by entering 0, 1, or 2\r\n# 0 for Rock, 1 for Paper, 2 for Scissors\r\n```\r\n\r\n### Example Game Session\r\n```python\r\n# User chooses Paper (1)\r\nuser_choice = 1\r\n\r\n# Computer randomly selects Rock (0)\r\ncomputer_choice = 0\r\n\r\n# Determine the winner\r\nif (computer_choice == 0 and user_choice == 1):\r\n    print(\"You Win!\")\r\nelif (computer_choice == user_choice):\r\n    print(\"Draw!\")\r\nelse:\r\n    print(\"You lose!\")\r\n\r\n# Display choices\r\nprint(f\"Your choice is: {Expression[user_choice]}\")\r\nprint(f\"Computer choice is: {Expression[computer_choice]}\")\r\n```\r\n\r\n## 📖 How It Works\r\nThe game logic is based on simple conditional statements:\r\n- If the user's choice beats the computer's choice according to standard rules, the user wins\r\n- If both choices are the same, it's a draw\r\n- Otherwise, the computer wins\r\n\r\nThe computer's choice is generated using Python's `random.randint(0, 2)` function, ensuring a fair random selection.\r\n\r\n## ⚖️ License\r\nDistributed under the MIT License. See [LICENSE](LICENSE) for details.\r\n\r\n---\r\n\r\n\u003e **Note**: This implementation is for educational and entertainment purposes. The game uses a simple random algorithm for the computer opponent, which is not cryptographically secure.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahadelahikhan%2Frock-paper-scissors-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffahadelahikhan%2Frock-paper-scissors-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffahadelahikhan%2Frock-paper-scissors-python/lists"}