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)

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

hub_games-0.1.2.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.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hub_games-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 45e50277a53943ba02bd59e2b0b7649ee074be7bb0128b42e81ca8d6c31928a8
MD5 0c04f4a89470f213dac9303ad0c62511
BLAKE2b-256 79db3e9d41a903fea929796d4292ccda26d3bd1976129437a9ba569da7dd2304

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hub_games-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b4141de37187cd5ff4b956904b452efb6b8ae7c82287087749b8fd715cb90d56
MD5 37fda178a22f63e4d1aa85bfeaaef44c
BLAKE2b-256 9867e965efc7b2b226363ba972d357e9e83044cf40c274ce507d6bc29e55ef76

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