Skip to main content

figrid_board/
lib.rs

1//! A library for the Five-in-a-Row (Gomoku) game.
2//!
3//! Starting from 0.4.0 the primary engine is NNUE-based (powered by the
4//! [`noru`](https://crates.io/crates/noru) core). The pre-0.4 symbolic
5//! evaluator, rule/rec/tree stack, and generic `Eval<SZ>` trait live under
6//! the [`legacy`] module — it is preserved alongside the new NNUE engine
7//! so the original `pbrain-figrid-legacy` executable and any 0.3.x
8//! downstream users still work. This preservation is a maintainer choice,
9//! not a promise of ABI stability.
10
11pub mod board;
12pub mod coord;
13pub mod eval;
14pub mod features;
15pub mod heuristic;
16pub mod pattern_dense;
17pub mod pattern_table;
18pub mod search;
19pub mod transposition;
20pub mod vct;
21
22pub mod legacy;
23
24pub use board::{
25    to_idx, to_rc, BitBoard, Board, GameResult, Move, Stone, BOARD_SIZE, NUM_CELLS,
26};
27pub use coord::{Coord, Coord15, Coord20, CoordState, Rotation};
28pub use eval::{evaluate, IncrementalEval};
29pub use features::GOMOKU_NNUE_CONFIG;
30pub use heuristic::{scan_line, LineInfo, DIR};
31pub use search::{SearchResult, Searcher};
32pub use vct::{search_vct, VctConfig};
33
34/// Possible errors returned from this crate.
35#[derive(Clone, Debug, PartialEq)]
36#[repr(u8)]
37pub enum Error {
38    ParseError,
39    InvalidCoord,
40    CoordNotEmpty,
41    RecIsEmpty,
42    RecIsFull,
43    RecIsFinished,
44    ItemNotExist,
45    TransformFailed,
46    CursorAtEnd,
47}