Go v0.4.0 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
Link to this section Functions
Add move to a board.
adjacent_coordinates(t(), coordinate()) :: list_of_coordinates()
Returns a list of valid adjacent coordinates.
group(t(), coordinate()) :: list_of_coordinates()
Returns the group for a given coordinate Recursive calculation differs from godash
is_legal_black_move(t(), coordinate()) :: boolean()
Returns the validity of a black move
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.
is_legal_white_move(t(), coordinate()) :: boolean()
Returns the validity of a white move
killed_stones(t(), coordinate(), color()) :: list_of_coordinates()
Returns the list of killed stones from a coordinate and color Not in godash
liberties(t(), coordinate()) :: list_of_coordinates()
Returns the list of liberties from a coordinate
liberty_count(t(), coordinate()) :: integer()
Returns the numbder of liberties from a coordinate
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
matching_adjacent_coordinates(t(), coordinate(), color()) :: list_of_coordinates()
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.
place_stones(t(), list_of_coordinates(), color()) :: {:ok, t()} | {:error, String.t()}
remove_stone(t(), coordinate()) :: {:ok, t()}
Remove the stone at the given location.
remove_stones(t(), list_of_coordinates()) :: {:ok, t()}
Reset. Not in original godash!
Like pass move, but does not change history state. Not in original godash!