Crate gomoku_core [] [src]

Modules

board

Main module, contains basics Structures.

captures_on_alignement

Returns possible positions for captures for all Alignments.

Structs

Alignment

Represent the backward bound, the number of stones of the same color before pos, the number of stones of the same color after pos and the forward bound.

Axes

Represent all the 4 axes.

Directions

Represent all the 8 directions. The only way to create a Direction is from a [T; 8].

Enums

BoundState

Represent the status of an alignment bound.

Color

Represent stone possible colors (Black and White).

Constants

BOT

Bottom direction.

BOT_LEFT

Bottom combined with left direction.

BOT_RIGHT

Bottom combined with right direction.

DIAGONAL_DOWN

Diagonal down axis.

DIAGONAL_UP

Diagonal up axis.

GRID_LEN

Represent the width and height of the Grid.

HORIZONTAL

Horizontal axis.

LEFT

Left direction.

RIGHT

Right direction.

TOP

Top direction.

TOP_LEFT

Top combined with left direction.

TOP_RIGHT

Top combined with right direction.

VERTICAL

Vertical axis.

Functions

get_alignments

Returns alignments at pos for the given color.

get_captures

Get all possible captures at pos for the given color.

get_free_threes

Returns the free-threes at pos for the color.

Type Definitions

Axis

Type used to represent an axis.

Direction

Used to represent 8 directions for more clarity.

Grid

Represent the Gomoku grid (19x19).

Position

Represent a position on the Grid.

Tile

Represent a Grid tile, None indicates no stone.