Skip to main content

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)

pip install Hub_Games

✅ pipx (best for CLI usage)

pipx install Hub_Games

✅ uv (if you use uv package manager)

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 game_hub 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:
gamesgame_name

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

hub_games-0.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hub_games-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file hub_games-0.1.0.tar.gz.

File metadata

  • Download URL: hub_games-0.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for hub_games-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2e2565961ab7f3e69c53de9cae91d5d3dd6fc2df64a65aa8adf422b1133dd8b2
MD5 d50207bf2949e252cfbc7324e0c0ad6e
BLAKE2b-256 09d213b6c7b806f1baeb1ca4344b575d24caebfd93283084f850de570d3d8aed

See more details on using hashes here.

File details

Details for the file hub_games-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hub_games-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for hub_games-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 864625bdb4768e992f0e2237436060dbf630d53799d2c150f47b2796cc20d109
MD5 f05264212f003f2ffd092ad8c465c0e2
BLAKE2b-256 5858e9fab6e067434b165aa9c12a6fc5276ec75429d0d12a3f705744e2475e8a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page