crow

Types

pub type Check {
  Check(
    can_move: Bool,
    player: Player,
    piece: Piece,
    path: List(Coordinate),
    captures: List(Coordinate),
  )
}

Constructors

  • Check(
      can_move: Bool,
      player: Player,
      piece: Piece,
      path: List(Coordinate),
      captures: List(Coordinate),
    )
pub type Gamestate {
  Gamestate(
    players: players.Players,
    round: round.Round,
    board: board.Board,
  )
}

Constructors

  • Gamestate(
      players: players.Players,
      round: round.Round,
      board: board.Board,
    )

Functions

pub fn deploy(state: Gamestate, position: String, player: String, piece: Piece) -> Gamestate
pub fn get_current_player(state: Gamestate) -> Player
pub fn get_player(state: Gamestate, at: Int) -> Player
pub fn get_player_positions(state: Gamestate, player: Player) -> Map(
  Coordinate,
  Check,
)
pub fn get_position(state: Gamestate, position: String) -> Check
pub fn get_positions(state: Gamestate) -> Map(Coordinate, Check)
pub fn get_turn(state: Gamestate) -> Int
pub fn move(state: Gamestate, from_position: String, to_position: String) -> Gamestate
pub fn new() -> Gamestate
pub fn next(state: Gamestate) -> Gamestate
pub fn players(state: Gamestate, p1: String, p2: String) -> Gamestate
Search Document