Download the executable for your platform - no installation required!
Tic-Tac-Toe built in Rust with the Bevy game engine. Features AI opponent using Minimax, responsive UI, and a modular ECS-based design.
- Download & Play
- Features
- Quick Start
- Development Setup
- Architecture
- AI Logic
- Contributing
- Development Standards
- Performance
- Tech Stack
- Future Plans
- License
- โ Human vs AI gameplay with intelligent opponent
- ๐ง Minimax algorithm with alpha-beta pruning for unbeatable AI
- ๐ฎ Responsive mouse controls - click any cell to play
- ๐๏ธ Modern ECS architecture using Bevy game engine
- ๐ Automatic turn management and game flow
- ๐ฑ Cross-platform support (Windows, macOS, Linux)
- ๐งช Comprehensive unit tests for AI logic
- โก High performance - native Rust speed
- Download for your platform using the buttons above
- Run the executable - double-click to play
- No installation needed - runs immediately
git clone https://github.com/Lymah123/bevy-tic-tac-toe
cd bevy-tic-tac-toe
cargo run --release# Clone and setup
git clone https://github.com/Lymah123/bevy-tic-tac-toe
cd bevy-tic-tac-toe
# Install dependencies
cargo fetch
# Run in development mode (with debug info)
cargo run
# Run with optimizations
cargo run --release# Run all tests
cargo test
# Run specific test module
cargo test ai_logic
# Run tests with output
cargo test -- --nocapture
# Test with coverage (requires cargo-tarpaulin)
cargo tarpaulin --out html# Format code
cargo fmt
# Lint and suggestions
cargo clippy
# Check for improvements
cargo clippy -- -W clippy::pedantic
# Audit dependencies
cargo auditThis game follows the ECS (Entity-Component-System) architecture using Bevy.
| Layer | Purpose |
|---|---|
| Components | Describe game entities (e.g., Cell, Marker) |
| Systems | Logic handlers (input, AI, rendering, gameplay) |
| Resources | Global state (game mode, board, statistics) |
| Events | Decoupled messaging (player move, game over) |
| AI Logic | Pure minimax functions (no Bevy dependency) |
src/
โโโ main.rs # App setup and system registration
โโโ components.rs # ECS components (BoardPosition, CellMark)
โโโ resources.rs # Global state (BoardState, GameMode)
โโโ events.rs # Event definitions (PlayerMove, GameOver)
โโโ types.rs # Game enums and data structures
โโโ config.rs # Game constants and configuration
โโโ ai_logic.rs # Pure AI algorithms (testable)
โโโ systems/
โโโ setup.rs # Game initialization
โโโ input.rs # Mouse input handling
โโโ gameplay.rs # Core game logic
โโโ ai.rs # AI integration
โโโ ui.rs # User interface
The AI supports three difficulty levels:
- ๐ข Easy: Random valid moves
- ๐ก Medium: Minimax with depth limit
- ๐ด Hard: Full-depth Minimax with alpha-beta pruning
The AI is implemented in a pure Rust module (ai_logic.rs) so it can be unit tested independently of Bevy.
Contributions are welcome! Please feel free to submit issues, fork the repository, and create pull requests.
- Fork the repository
- Create a feature branch
(git checkout -b feature/amazing-feature) - Commit your changes
(git commit -m 'Add amazing feature') - Push to the branch
(git push origin feature/amazing-feature) - Open a Pull Request
- Follow Rust conventions and use
cargo fmt - Add unit tests for new functionality
- Update documentation for API changes
- Ensure no clippy warnings in your code
- Download Size: ~15MB executable
- Startup Time: < 1 second on modern hardware
- Memory Usage: ~50MB RAM typical
- Frame Rate: 60 FPS consistent
- No Dependencies: Self-contained executable
- Rust - Systems programming language
- Bevy Engine - Data-driven game engine
[dependencies]
bevy = "0.11" # Main game engine- ECS (Entity-Component-System) - Bevy's core architecture
- Event-Driven Design - Decoupled system communication
- Resource Management - Global state handling
- System Scheduling - Ordered execution pipelines
- Bevy Engine: Outstanding ECS game engine
- Rust Community: Excellent ecosystem and support
- Minimax Algorithm: Classic game theory foundation
- Open Source Contributors: Thanks to everyone who contributes!
- Download and run the executable for your platform
- Make your move - Click any empty cell (you play as X)
- AI responds - The AI automatically places O
- Win conditions - Get 3 in a row (horizontal, vertical, or diagonal)
- Windows: Windows 10+ (64-bit)
- macOS: macOS 10.12+ (64-bit)
- Linux: Most modern distributions (64-bit)
- RAM: 50MB minimum
- Storage: 15MB disk space
| Action | Input |
|---|---|
| Place mark | Left mouse click on empty cell |
| Restart game | R key (if implemented) |
| Exit game | Alt + F4 / Cmd + Q |
- Mode selector screen with in-game menu
- Sound effects and visual effects
- Mobile-friendly UI (larger touch zones)
- Undo/Redo move history
- Export match statistics to file
This project is licensed under the MIT License - see the LICENSE file for details.
- โ Commercial use allowed
- โ Modification allowed
- โ Distribution allowed
- โ Private use allowed
- โ No warranty provided
Built with โค๏ธ in Rust
If you found this project useful, please consider giving it a โญ!
.png)