Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added topics/tic_tac_toe/.gitignore
Empty file.
133 changes: 133 additions & 0 deletions topics/tic_tac_toe/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions topics/tic_tac_toe/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "tic_tac_toe"
version = "0.1.0"
edition = "2021"
authors = ["[email protected]"]
description = "A command-line Tic Tac Toe game with an unbeatable AI using the Minimax algorithm"

[dependencies]
rand = "0.8.5"
59 changes: 59 additions & 0 deletions topics/tic_tac_toe/README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Tic Tac Toe with Unbeatable AI

A command-line Tic Tac Toe game implemented in Rust, featuring an unbeatable AI using the Minimax algorithm.

## Project Structure

```
tic_tac_toe/
├── src/
│ ├── board.rs # Game board representation and logic
│ ├── player/
│ │ ├── mod.rs # Player trait definition
│ │ ├── human.rs # Human player implementation
│ │ └── ai.rs # AI player with Minimax algorithm
│ ├── game.rs # Game state and flow management
│ ├── main.rs # Entry point and user interface
│ └── lib.rs # Library exports
├── tests/ # Unit tests
├── docs/
│ └── architecture_EN.md # Detailed architecture documentation (EN)
└── README_EN.md
```

## How to Run the Project

1. **Build**
```bash
cargo build
```

2. **Run**
```bash
cargo run
```

3. **Test**
```bash
cargo test
```

## How to Play

1. Start the game with `cargo run`
2. Enter your name when prompted
3. The game randomly decides who goes first
4. On your turn, enter coordinates as "row column" (e.g., "1 1" for the center)
5. Indices range from 0 to 2, as shown on the board

## Main Features

- **Unbeatable AI** using the Minimax algorithm
- Command-line interface with Unicode display
- Modular and object-oriented architecture
- Comprehensive unit tests

## Documentation

For detailed documentation of the project architecture, see:
- English version: `docs/architecture_EN.md`
Loading