Crate tic_tac_toe_rust

Source
Expand description

The Tic-Tac-Toe game. This crate provides the logic for the game, as well as a basic frontend for CLI. The game is played by two players, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner. The game can be played versus another human player or versus a computer player. The computer player can be configured to play randomly or to use the minimax algorithm.

Modules§

frontend
A module to take care of the frontend for the tic tac toe game
game
The game module contains the TicTacToe struct, which is the main entry point for the game. And it contains the Player trait, which is used to define the behavior of a player. And it contains the Renderer trait, which is used to define the behavior of a renderer. And it contains the minimax module, which contains the MinimaxPlayer struct, which is a player that uses the minimax algorithm to make moves.
logic
This module contains the logic of the game. It contains the models, which are the data structures used in the game. And it contains the validators, which are the functions that validate the game state.