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

Uploaded Python 3

File details

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

File metadata

  • Download URL: hub_games-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 dfd7ed4aaff91dd4d35c4a547b369ece012d8db8c20494b38ac589b5f02866f7
MD5 eadd6ba27521f5212ddc56139bcaa468
BLAKE2b-256 c1f2520e003f255250a2d55c547e7978aae6a4fc7d72f74d6bbf007d751f985e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: hub_games-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 afb7bc4f71f6a98d0020758cf7301ff8e82ad9aba6a8779865203dc7dc8b7e79
MD5 cbdf6e5c33cb8542e54e2a065b8eca88
BLAKE2b-256 b5d041cbcc529132707d35de11898cbd7d745d07bade1bcab89dae41266656d0

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