game

Types

pub type Game {
  Game(
    board: BoardBB,
    turn: Color,
    history: List(MoveWithCapture),
    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(MoveWithCapture),
      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) -> Result(List(Move), String)
pub fn apply_move(game: Game, move: Move) -> Result(Game, String)
pub fn apply_move_raw(
  game: Game,
  move: Move,
) -> Result(Game, String)
pub fn apply_move_san_string(
  game: Game,
  move: String,
) -> Result(Game, String)
pub fn apply_move_uci(
  game: Game,
  move: String,
) -> Result(Game, String)
pub fn disable_status(game: Game) -> Game
pub fn from_fen_string(fen_string: String) -> Result(Game, a)
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) -> Result(String, String)
pub fn print_board_from_fen(
  fen: String,
) -> Result(String, String)
pub fn to_fen(game: Game) -> String
pub fn undo_move(game: Game) -> Result(Game, String)
Search Document