super-ttt 0.2.0

An implementation of super tic tac toe
Documentation
  • Coverage
  • 100%
    18 out of 18 items documented1 out of 10 items with examples
  • Size
  • Source code size: 24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.16 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 10s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ThatXliner

Super Tic Tac Toe

Crates.io docs.rs

This Rust library provides a core implementation of the logic for playing Super Tic Tac Toe. Super Tic Tac Toe is an extended version of the traditional Tic Tac Toe game, played on a 9x9 grid of smaller Tic Tac Toe boards. The rules of the game are explained in detail in the Wikipedia entry.

Docs are found here

Installation

To use this library, add it to your Cargo.toml via

$ cargo add super-ttt

Example

Here's an example that demonstrates how to use this library to play a game:

use super_ttt::{Game, Player};

fn main() {
    // Make moves and check for a winner
    let mut game = Game::new();
    game.make_move(0, 0, 1, 1).unwrap();
    game.make_move(1, 1, 0, 0).unwrap();
    game.make_move(0, 1, 2, 2).unwrap();
    game.make_move(2, 2, 0, 2).unwrap();
    game.make_move(0, 2, 1, 0).unwrap();

    match game.get_winner() {
        super_ttt::GameState::Winner(player) => {
            println!("Player {:?} wins!", player);
        }
        super_ttt::GameState::Tie => {
            println!("It's a tie!");
        }
        super_ttt::GameState::InProgress => {
            println!("The game is still in progress.");
        }
    }
}

Contributing

Contributions to this project are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License

This library is licensed under the MIT License. See the LICENSE file for more information.