A CLI Python hub to play multiple games: Rock Paper Scissors, Tic Tac Toe, and Guess the Number
Project description
Game_Hub
A Python package that lets you play multiple games from the command line or directly in Python, including:
- Tic Tac Toe
- Rock Paper Scissors
- Guess the Number
Installation
✅ pip (recommended)
py -m pip install Hub-Games
✅ pipx (best for CLI usage)
py -m pipx install Hub-Games
✅ uv (if you use uv package manager)
py -m uv pip install Hub-Games
✅ Development (editable install)
For testing or contributing:
git clone https://github.com/rick-rocks123/Game_Hub.git
cd <repo-folder>
pip install -e .
Usage
✅ Command-line usage
Run a specific game using the CLI:
1️⃣Tic Tac Toe (pick starting player)
gamehub -t x # decided whether player x or o starts
2️⃣Rock Paper Scissors
gamehub -r
3️⃣ Guess the Number
gamehub -n
✅ Bash commands
Disclaimer: you can use -h or --help
gamehub --help
or
py gamehub --help
✅ Python usage
Example 1: direct usage
from gamehub import play_tic_tac_toe, play_rps, guess_number
games = {
"tic_tac_toe": play_tic_tac_toe,
"rps": play_rps,
"number": guess_number
}
game_name = input("Which game? tic_tac_toe, rps, or number: ").strip()
if game_name in games:
games[game_name]() # ✅ call the function
else:
print("Invalid game name")
Example 2: usage with CLI-style arguments
from gamehub import argparse_commands
def main():
argparse_commands()
if __name__ == "__main__":
main()
use -h or -help to see what cli-style arguments you have
Game Gallery (ASCII Preview)
Tic Tac Toe
-----------
|X | O | X|
|O | X | O|
|X | X | O|
-----------
Rock Paper Scissors (2 Players)
Player one: rock
Player two: scissors
Player 1 wins!
Score → P1: 1 | P2: 0
Guess the Number
Hello, Alice! I am thinking of a number between 1 and 10:
input your guess: 5
Too low!
input your guess: 8
Too high!
input your guess: 7
Alice guessed correctly in 3 guesses!
Notes
- All games handle graceful exits if you press Ctrl+C or EOF.
- Tic Tac Toe and RPS support 2-player CLI input.
- Number Guessing randomly selects a number from 1–100.
- You can add more games by following the
argparse_commands()pattern.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hub_games-0.1.3.tar.gz.
File metadata
- Download URL: hub_games-0.1.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
182fb9d634bbc272d3a6afa15181c82adcd5b179094bceebf5651e0fef6ad959
|
|
| MD5 |
b85e412b0bab248d56eeace217471872
|
|
| BLAKE2b-256 |
d1bd406d9b9ad091773a6309b2907ee0f27e9b8ca416cdf8d88a901f084afede
|
File details
Details for the file hub_games-0.1.3-py3-none-any.whl.
File metadata
- Download URL: hub_games-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55ddd0210964370fc023aa1cb947fcda9645b43a59cf11aebceb770cd6c81dfa
|
|
| MD5 |
7c46a60c33a32708538949d9d2e7a7da
|
|
| BLAKE2b-256 |
01df0581d50772b9087f06bb8662952a926a99a98f8fa2ee8365ac78bdad390b
|