A modern, terminal-based Tic-Tac-Toe game built with C++ and FTXUI.
Tricky is a console application that reimagines the classic "Tres en Raya" game. Unlike standard command-line games, Tricky uses FTXUI to provide a fully interactive interface with mouse support, dynamic layouts, and a responsive design within your terminal.
- Interactive UI: Clickable board buttons using the mouse.
- Score Tracking: Real-time updates of Wins and Losses for both players.
- Game States: Automatic detection of Win, Loss, and Draw (Empate) conditions.
- Smart Menus: Context-aware menus that appear only when the game ends.
- Modern C++: Written in C++17 using clean code practices (Enums, separating logic/UI).
- Cross-Platform: Runs on Linux, macOS, and Windows (via terminal).
demo.mp4
To build this project, you need:
- C++ Compiler: Supporting C++17 or later (GCC, Clang, MSVC).
- CMake: Version 3.20 or higher.
- Git: To fetch the repository and dependencies.
-
Clone the repository:
git clone https://github.com/MrTanuk/tricky-tui.git cd tricky-tui -
Create a build directory:
mkdir build && cd build
-
Configure and Compile:
cmake .. cmake --build . -
Run the game:
./app/app
- Mouse: Click on the grid cells to place your mark (X or O).
- Keyboard (Menu):
- Use
UP/DOWNarrows to navigate the "Game Over" menu. - Press
ENTERto select an option.
- Use
The project follows a modular architecture separating logic from the interface.
.
├── app/
│ └── main.cpp # Entry point
├── include/
│ └── trickyLib/
│ └── tricky.hpp # Class definitions (Player, Tablero)
├── src/
│ └── tricky.cpp # Implementation of logic and UI rendering
└── CMakeLists.txt # Build configuration
- Basic Game Logic (Win/Draw detection).
- Interactive UI with FTXUI.
- Scoreboard system.
- Replay/Exit Menu.
- Upcoming: Input screens for Player Names (Login UI).
- Upcoming: Multiplayer local
- Upcoming: AI implementation for single-player mode.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the game logic or UI.
This project is open-source. Feel free to use it for educational purposes.