Skip to content

Conversation

@aurianecodebien
Copy link

@aurianecodebien aurianecodebien commented Oct 19, 2025

Tic-Tac-Toe AI Agent Implementation

Description

This PR implements a complete Tic-Tac-Toe game with an unbeatable AI opponent using the Minimax algorithm.

Features

  • Optimal AI: Implements Minimax algorithm with depth-first search
  • Interactive CLI: User-friendly command-line interface
  • Comprehensive Testing: 9 unit tests covering all game scenarios
  • Clean Architecture: Modular design with 5 well-separated modules
  • Code Quality: Zero warnings (cargo build + clippy), fully formatted

Implementation Details

Modules

  • types.rs: Core type definitions (Player, Cell)
  • board.rs: 3x3 game board representation
  • game.rs: Game logic and win detection
  • ai.rs: Minimax algorithm implementation
  • main.rs: CLI interface

Testing

  • 6 game logic tests (win detection, draws, invalid moves)
  • 3 AI behavior tests (blocking, winning, move selection)

Documentation

  • Complete architecture documentation in docs/architecture.md
  • Covers project definition, components, module interactions, and usage

How to Test

cd topics/tic-tac-toe

# Run the game
cargo run --release

# Run tests
cargo test

# Check code quality
cargo clippy
cargo fmt --check

jorisvilardell added a commit to jorisvilardell/project-2427 that referenced this pull request Oct 30, 2025
…isShare protocol (dev-sys-do#6)

* feat(storage): add StorageError enum with Display implementation and update StorageRepository trait

* feat(storage): implement FSStorageRepository with file handling and sanitization

* feat(command): update CommandService trait to include process_binary_data method

* feat(network): make command_service public in NetworkServiceImpl

* feat(application): implement FerrisShareState struct with command and network services

* refactor(network): remove unused HashSet import from entities.rs

* feat(main): refactor main function to initialize services with storage repository

* feat(storage): add Display implementation for StorageError enum

* feat(command): implement From trait for CommandError to String conversion

* feat(command): update execute_protocol_command to return OkHousten and enhance process_binary_data with error handling

* refactor(network): handle process write binary data and closing connection on sender close it

* feat(network): enhance TransferState to track current file during data transfer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant