A collection of classic games playable in your terminal
Project description
Terminal Games Collection ๐ฎ
A collection of classic games playable in your terminal, built with Python.
๐ฏ Games Included
1. Tic-Tac-Toe
- Play vs Computer (AI) - Challenge a simple AI opponent
- Multiplayer (Local Network) - Play with friends on the same WiFi
- Multiplayer (Global) - Play with anyone worldwide using ngrok
2. Chess โ๏ธ
- Play against an AI opponent
- Classic chess with Unicode pieces
- Standard chess rules and moves
3. Sudoku ๐ข
- Number puzzle game with three difficulty levels
- Easy - 40 cells removed
- Medium - 50 cells removed
- Hard - 60 cells removed
- Hints and solution viewer available
4. Text Adventure ๐ก๏ธ
- Interactive fiction game
- Explore a fantasy world
- Solve puzzles and defeat enemies
- Fight a dragon and find legendary treasure
- Multiple locations, items, and paths
๐ Getting Started
Installation
Install the package using pip:
pip install t-games
To ensure you have the latest version:
pip install --upgrade t-games
That's it! All dependencies (including python-chess for the Chess game) will be installed automatically.
Running the Games
Main Menu (Recommended)
Launch the main menu to choose any game:
games
Direct Game Launch
Run individual games directly:
tictactoe # Launch Tic-Tac-Toe directly
chess-game # Launch Chess directly
sudoku-game # Launch Sudoku directly
adventure-game # Launch Text Adventure directly
Development Installation
If you want to contribute or run from source:
- Clone the repository:
git clone https://github.com/pavansai-tanguturi/t-games.git
cd t-games
- Install in development mode:
pip install -e .
๐ฎ Game Instructions
Tic-Tac-Toe
-
Choose your game mode:
- 1: Play vs Computer
- 2: Host a game (wait for friend)
- 3: Join a game (connect to host)
-
For Network Play:
- Same WiFi: Host shares their local IP address
- Different Networks: Use ngrok for global play
# In a separate terminal: ngrok tcp 65432
- Share the ngrok address (e.g.,
0.tcp.ngrok.io:12345) with your friend
-
Enter moves as:
row column(e.g.,1 2)
Chess
- Enter moves in UCI format:
e2e4 - Type
exitto quit - You play as White (uppercase pieces)
- AI plays as Black
Sudoku
Commands:
move <row> <col> <num>- Place a number (e.g.,move 1 1 5)remove <row> <col>- Remove a numberhint- Get a hint for an empty cellsolution- View the complete solutionnew <difficulty>- Start a new game (easy/medium/hard)quit- Exit game
Text Adventure
Common Commands:
north,south,east,west- Move in directionstake <item>- Pick up itemstalk to <character>- Interact with NPCsfight- Engage in combatuse <item>- Use items from inventoryinventoryori- Check your itemshint- Get location-specific hintshelp- View available commandsquit- Exit game
Tips:
- Buy a torch early to explore the cave
- Talk to NPCs for valuable information
- Collect items and gold throughout your journey
- The enchanted sword is essential for combat
๐ Network Multiplayer Setup
Playing on Same Network (LAN)
- Host starts the game and selects "Host"
- Host shares their local IP address (displayed in-game)
- Client selects "Join" and enters the host's local IP
- Play together!
Playing Globally (Different Networks)
Using ngrok:
- Download ngrok: https://ngrok.com/download
- Host starts the game and selects "Host"
- In a separate terminal, run:
ngrok tcp 65432
- ngrok will display a forwarding address like:
Forwarding: tcp://0.tcp.ngrok.io:12345 -> localhost:65432 - Share the ngrok address with your friend
- Client selects "Join" โ "Enter ngrok address" โ enters
0.tcp.ngrok.io:12345 - Play together from anywhere in the world!
๐ Requirements
- Python: 3.7 or higher
- Dependencies: Automatically installed with pip
python-chess>=1.9.0(for Chess game)
All dependencies are managed automatically when you install via pip.
๐จ Features
- Terminal-based UI - No GUI required, runs anywhere Python is installed
- Cross-platform - Works on Windows, macOS, and Linux
- Network multiplayer - Play with friends locally or globally
- Multiple difficulty levels - Suitable for all skill levels
- Interactive gameplay - Rich text-based experiences
- Save-free gaming - Jump in and play instantly
๐ ๏ธ Technical Details
- Language: Python 3
- Network Protocol: TCP sockets for multiplayer
- Architecture: Modular design with separate game files
- Input: Text-based command interface
๐ Project Structure
t-games/
โโโ games/ # Main package directory
โ โโโ __init__.py # Package initializer
โ โโโ main.py # Main launcher with game menu
โ โโโ tictactoe.py # Tic-Tac-Toe game with AI and network multiplayer
โ โโโ chess.py # Chess game with AI
โ โโโ sudoku.py # Sudoku puzzle game
โ โโโ adventure.py # Text adventure game
โโโ setup.py # Package configuration
โโโ pyproject.toml # Build configuration
โโโ requirements.txt # Python dependencies
โโโ LICENSE # MIT License
โโโ README.md # This file
๐ฆ PyPI Package
This project is published on PyPI: https://pypi.org/project/t-games/
Install with: pip install t-games
๐ค Contributing
Contributions are welcome! To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-game) - Commit your changes (
git commit -m 'Add amazing game') - Push to the branch (
git push origin feature/amazing-game) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Links
- PyPI: https://pypi.org/project/t-games/
- GitHub: https://github.com/pavansai-tanguturi/t-games
- Issues: https://github.com/pavansai-tanguturi/t-games/issues
๐ฅ Authors
- Pavan Sai Tanguturi - @pavansai-tanguturi
- Siddartha Karumuri - @siddardha003
๐ Have Fun!
Enjoy playing these classic games in your terminal. Whether you're challenging the AI, playing with friends locally, or connecting globally via ngrok, there's something for everyone!
Made with โค๏ธ using Python
Project details
Release history Release notifications | RSS feed
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 t_games-1.0.6.tar.gz.
File metadata
- Download URL: t_games-1.0.6.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f4c815e46b3630ed2e4467558d0f1745c8433688f3060615ed849fe6c3f9c87
|
|
| MD5 |
fd6b4281157984dadb8a6be2e788a491
|
|
| BLAKE2b-256 |
a082c84c82fdc014c1126fc92b9a1113c61f3328be4572cc058aa750e858d0dc
|
File details
Details for the file t_games-1.0.6-py3-none-any.whl.
File metadata
- Download URL: t_games-1.0.6-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e412e96267e1bee5c3c6656d9083c85d5ddb86d6592842d8b34da7ff88055567
|
|
| MD5 |
b3102b9f500b34e31b87fcdcab63d288
|
|
| BLAKE2b-256 |
bf7ee2cb4de689d443770a9ed3cd0d733f30a0d3233e036808a51a59000016e4
|