Go v0.4.3 Go.Board View Source
Documentation for Go.Board
Godash port to elixir godash url: https://github.com/duckpunch/godash
Avril 2017, hf
Link to this section Summary
Functions
Add move to a board.
Returns a list of valid adjacent coordinates.
Returns the group for a given coordinate Recursive calculation differs from godash
Returns the validity of a black move
Returns the validity of a move
Returns the validity of a white move
Returns the list of killed stones from a coordinate and color Not in godash
Returns the list of liberties from a coordinate
Returns the numbder of liberties from a coordinate
Returns a list of matching adjacent coordinates It will try to guess the color if not specified
Returns a list of matching adjacent coordinates For a given color
Returns a new Board structure from a map.
Returns the opposite color of a given one.
Pass move. Not in original godash!
Place one stone on the board.
Remove the stone at the given location.
Reset. Not in original godash!
Like pass move, but does not change history state. Not in original godash!
Link to this section Types
Specs
color() :: :black | :white | :empty
Specs
Specs
list_of_coordinates() :: [coordinate()]
Specs
move() :: {coordinate(), color()}
Specs
Link to this section Functions
Add move to a board.
Specs
adjacent_coordinates(t(), coordinate()) :: list_of_coordinates()
Returns a list of valid adjacent coordinates.
Specs
group(t(), coordinate()) :: list_of_coordinates()
Returns the group for a given coordinate Recursive calculation differs from godash
Specs
is_legal_black_move(t(), coordinate()) :: boolean()
Returns the validity of a black move
Specs
Returns the validity of a move
Modified from godash implementation Original implementation create a new board to check if it will_have_liberties Instead, check if any of surrounding helping groups have more than 1 lib
This does not check superko, as it needs history to validate ko rule. It is done when adding a move, by checking if next position + next_turn does not exists in history already.
Specs
is_legal_white_move(t(), coordinate()) :: boolean()
Returns the validity of a white move
Specs
killed_stones(t(), coordinate(), color()) :: list_of_coordinates()
Returns the list of killed stones from a coordinate and color Not in godash
Specs
liberties(t(), coordinate()) :: list_of_coordinates()
Returns the list of liberties from a coordinate
Specs
liberty_count(t(), coordinate()) :: integer()
Returns the numbder of liberties from a coordinate
Specs
matching_adjacent_coordinates(t(), coordinate()) :: list_of_coordinates()
Returns a list of matching adjacent coordinates It will try to guess the color if not specified
Specs
matching_adjacent_coordinates(t(), coordinate(), color()) :: list_of_coordinates()
Returns a list of matching adjacent coordinates For a given color
Specs
Returns a new Board structure from a map.
Specs
Returns the opposite color of a given one.
Specs
Pass move. Not in original godash!
Specs
Place one stone on the board.
Specs
place_stones(t(), list_of_coordinates(), color()) :: {:ok, t()} | {:error, String.t()}
Specs
remove_stone(t(), coordinate()) :: {:ok, t()}
Remove the stone at the given location.
Specs
remove_stones(t(), list_of_coordinates()) :: {:ok, t()}
Specs
Reset. Not in original godash!
Specs
Like pass move, but does not change history state. Not in original godash!