position

Types

pub type File {
  A
  B
  C
  D
  E
  F
  G
  H
}

Constructors

  • A
  • B
  • C
  • D
  • E
  • F
  • G
  • H
pub type Position {
  Position(file: File, rank: Rank)
}

Constructors

  • Position(file: File, rank: Rank)
pub type Rank {
  One
  Two
  Three
  Four
  Five
  Six
  Seven
  Eight
}

Constructors

  • One
  • Two
  • Three
  • Four
  • Five
  • Six
  • Seven
  • Eight

Functions

pub fn are_the_same(
  position1: Position,
  position2: Position,
) -> Bool
pub fn distance_between(
  position1: Position,
  position2: Position,
) -> Int
pub fn file_to_int(file: File) -> Int
pub fn file_to_string(file: File) -> String
pub fn from_int(i: Int) -> Option(Position)
pub fn get_file(file: File, y: Int) -> File
pub fn get_file_relative(
  file: File,
  y: Int,
  relative_to: Color,
) -> File
pub fn get_position(
  position: Position,
  x: Int,
  y: Int,
) -> Position
pub fn get_position_relative(
  position: Position,
  x: Int,
  y: Int,
  relative_to: Color,
) -> Position
pub fn get_rank(rank: Rank, x: Int) -> Rank
pub fn get_rank_relative(
  rank: Rank,
  x: Int,
  relative_to: Color,
) -> Rank
pub fn get_rear_black_rank(rank: Rank) -> Rank
pub fn get_rear_position(
  position: Position,
  color: Color,
) -> Position
pub fn get_rear_rank(rank: Rank, color: Color) -> Rank
pub fn get_rear_white_rank(rank: Rank) -> Rank
pub fn int_to_file(i: Int) -> File
pub fn int_to_rank(i: Int) -> Rank
pub fn rank_to_int(rank: Rank) -> Int
pub fn rank_to_string(rank: Rank) -> String
pub fn to_bitboard(position: Position) -> Bitboard
pub fn to_int(position: Position) -> Int
pub fn to_string(position: Position) -> String
Search Document