Triple-triad
A terminal-based Python implementation of the classic Triple Triad card game from Final Fantasy VIII, complete card collection with the classical rules
✨ Features
- 110 cards from FFVIII
- Chiptune music — Retro-style background music generated with NumPy and played through pygame-ce
- Interactive deck builder — Browse, filter, and sort all cards before picking your hand
🎮 How to Play
Triple Triad is a 2-player card game played on a 3×3 grid. Each player has 5 cards. Players take turns placing one card on the board. When a card is placed adjacent to an opponent's card, the touching sides are compared — if the attacker's value is higher, the defender's card is captured. The player with the most cards on the board at the end wins.
┌──────────────────┬──────────────────┬──────────────────┐
│ │ │ │
│ [ 1 ] │ [ 2 ] │ [ 3 ] │
│ │ │ │
├──────────────────┼──────────────────┼──────────────────┤
│ ■Ifrit │ │ │
│ ▲ 9 │ [ 5 ] │ [ 6 ] │
│ ◀ 5 Ice 8 ▶ │ │ │
│ ▼ 6 │ │ │
├──────────────────┼──────────────────┼──────────────────┤
│ □Shiva │ │ │
│ ▲ 6 │ [ 8 ] │ [ 9 ] │
│ ◀ 6 Ice 9 ▶ │ │ │
│ ▼ 7 │ │ │
└──────────────────┴──────────────────┴──────────────────┘
- ■ = Your card
- □ = CPU's card
- Numbers inside empty cells = board position (1–9)
🚀 Getting Started
Prerequisites
- Python 3.13+
- NumPy (for audio synthesis)
- pygame-ce (for audio playback)
Installation from PyPI
Using pip:
pip install triple-triad-ff8
Using uv:
uv pip install triple-triad-ff8
Installation from Source
git clone https://github.com/fernando24164/triple-triad-ff8.git
cd triple-triad-ff8
uv sync --locked
Run the Game
python -m triple_triad
or
uv run triple-triad
or if installed via pip:
triple-triad
Help and Tutorial
To view the game tutorial and learn how to play:
triple-triad --help
or
triple-triad -h
This displays a comprehensive guide covering game rules, card mechanics, and gameplay tips.
🎵 Audio
The game includes a built-in chiptune soundtrack synthesized entirely in software:
- Generated with NumPy — no audio files required
- Played through pygame-ce — if pygame-ce is unavailable, the game runs silently
🧩 Rules
| Rule | Description |
|---|---|
| Open | CPU's hand is visible to the player |
| Same | If 2+ adjacent cards share equal values, all are captured |
| Plus | If 2+ adjacent cards share equal value sums, all are captured |
| Random | Cards are dealt randomly from the full pool |
🛠 Development
Install Dev Dependencies
uv sync --locked
Run Tests
uv run pytest
Lint
uv run ruff check .
🌐 Multiplayer (P2P)
Triple Triad supports direct peer-to-peer multiplayer over TCP.
How it works
- Host starts a lobby on a chosen port (default
64000). - Guest connects using the host's IP address and port.
- The game synchronises rules, board elements, and decks before starting.
⚠️ NAT / Firewall Limitations
The current P2P implementation uses direct TCP connections
| Scenario | Works? |
|---|---|
| Both players on the same local network | ✅ |
| Host has a public IP or port forwarding configured | ✅ |
Workarounds:
- Port forwarding — Configure your router to forward the chosen port (default
64000) to the host machine. - LAN play — Both players on the same local network work without any configuration.
- VPN — Use a VPN (e.g. Tailscale, ZeroTier, Hamachi) to create a virtual LAN.
🤝 Contributing
Contributions are welcome! Here's how to get started:
- Fork the repository
- Create a feature branch —
git checkout -b feature/my-feature - Make your changes — follow the existing code style
- Run tests —
pytest - Submit a pull request
Please open an issue first for major changes to discuss the approach.
Build
uv build
twine upload dist/*
📄 License
This project is for educational and personal use. Triple Triad is a minigame from Final Fantasy VIII, © Square Enix. All card names and game mechanics are the property of their respective owners.
Metadata
Release files for triple-triad-ff8 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| triple_triad_ff8-0.1.9.tar.gz | 4.5 MB | Without provenance | Details for triple_triad_ff8-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| triple_triad_ff8-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for triple_triad_ff8-0.1.9-py3-none-any.whl |
Total release size: 4.6 MB
Release files / triple_triad_ff8-0.1.9.tar.gz
| Download URL | triple_triad_ff8-0.1.9.tar.gz |
|---|---|
| Size | 4.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23f6ce9ea05ee3e75c6f6fa6796b0dc458d4cb9bdf2b22b3496859904b5a6596
|
|
BLAKE2b-256 checksum How to use checksums |
46e01ec561f0ce65e8d64b54419caf5d8c80f48347c2224500bc21d4d3ffacd8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.8
|
Release files / triple_triad_ff8-0.1.9-py3-none-any.whl
| Download URL | triple_triad_ff8-0.1.9-py3-none-any.whl |
|---|---|
| Size | 91.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c235e90433b9c2aa1660af75fe9ff4448928cc5cca2a3af0a216dad1e12ea73a
|
|
BLAKE2b-256 checksum How to use checksums |
62969b87095d0a7e44270bfefccb5ddc85b0122eb3a9a574273180187b6c21de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.8
|
Security for triple-triad-ff8 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.