game

Types

pub type Game {
  Game(
    board: BoardBB,
    turn: Color,
    history: List(Move),
    status: Option(Status),
    ply: Int,
    white_kingside_castle: CastleRights,
    white_queenside_castle: CastleRights,
    black_kingside_castle: CastleRights,
    black_queenside_castle: CastleRights,
    en_passant: Option(Position),
  )
}

Constructors

  • Game(
      board: BoardBB,
      turn: Color,
      history: List(Move),
      status: Option(Status),
      ply: Int,
      white_kingside_castle: CastleRights,
      white_queenside_castle: CastleRights,
      black_kingside_castle: CastleRights,
      black_queenside_castle: CastleRights,
      en_passant: Option(Position),
    )

Functions

pub fn all_legal_moves(game: Game) -> List(Move)
pub fn apply_move(game: Game, move: Move) -> Game
pub fn apply_move_san_string(
  game: Game,
  move: String,
) -> Result(Game, String)
pub fn apply_move_uci(game: Game, move: String) -> Game
pub fn disable_status(game: Game) -> Game
pub fn from_fen_string(fen_string: String) -> Game
pub fn load_pgn(pgn: String) -> Result(Game, String)
pub fn new_game() -> Game
pub fn new_game_without_status() -> Game
pub fn print_board(game: Game) -> Nil
pub fn print_board_from_fen(fen: String) -> Nil
pub fn to_fen(game: Game) -> String
pub fn undo_move(game: Game) -> Game
Search Document