Crate super_ttt

Source
Expand description

§Super Tic Tic Toe

This library provides a core that implements the logic for playing Super Tic Tac Toe.

The rules of said game are explained in the Wikipedia entry, with one exception: since it wasn’t specified in the Wikipedia article, the behavior for ties within small, traditional 3x3 tic tac toe boards will result in that board being unable to use. It will be “dead” or “locked”; nobody can use that board in their 3-in-a-row final win.

§Terminology

Because “board of boards” can get confusing on what you’re referring to, I’ll define some terms:

Game: the entire 9x9 super tic-tac-toe game or “large board”

Coordinates: An (x, y) pair where x and y are integers between and including 0 to 2. It represents the location of a section (a square for a board, a board for a game).

Board: a traditional 3x3 tic-tac-toe game or “small board”

Square: a cell of a traditional tic-tac-toe board. It will either be empty or containing an X/O,

Square coordinates: An (x, y) pair that, like a normal coordinate, represents the location of something. But unlike a regular coordinate, it represents the exact location of a specific square. X and Y will be integers between and including 0 to 8.

Modules§

errors
This module contains the errors that super_ttt may return.

Structs§

Board
Represents the 3x3 traditional Tic Tac Toe board
Game
Represents the 9x9 super Tic Tac Toe game. X starts

Enums§

GameState
Player
Represents a player (X or O)
Square
Represents a the content of a smaller Tic Tac Toe board

Constants§

BOARD_SIZE
The size length of the board and the game. This should never change.