status

Types

pub type DrawReason {
  Stalemate
  FiftyMoveRule
  ThreefoldRepetition
  InsufficientMaterial
  Manual
}

Constructors

  • Stalemate
  • FiftyMoveRule
  • ThreefoldRepetition
  • InsufficientMaterial
  • Manual
pub type Status {
  Draw(reason: DrawReason)
  Win(winner: Color, reason: String)
  InProgress(
    fifty_move_rule: Int,
    threefold_repetition_rule: Dict(ThreeFoldPosition, Int),
  )
}

Constructors

  • Draw(reason: DrawReason)
  • Win(winner: Color, reason: String)
  • InProgress(
      fifty_move_rule: Int,
      threefold_repetition_rule: Dict(ThreeFoldPosition, Int),
    )
pub type ThreeFoldPosition {
  ThreeFoldPosition(
    turn: Color,
    board: BoardBB,
    en_passant: Option(Position),
    white_kingside_castle: CastleRights,
    white_queenside_castle: CastleRights,
    black_kingside_castle: CastleRights,
    black_queenside_castle: CastleRights,
  )
}

Constructors

  • ThreeFoldPosition(
      turn: Color,
      board: BoardBB,
      en_passant: Option(Position),
      white_kingside_castle: CastleRights,
      white_queenside_castle: CastleRights,
      black_kingside_castle: CastleRights,
      black_queenside_castle: CastleRights,
    )
pub type WinReason {
  Checkmate
  Resignation
  Timeout
}

Constructors

  • Checkmate
  • Resignation
  • Timeout

Functions

pub fn to_string(status: Status) -> String
Search Document