Go v0.1.0 Go.Board
Documentation for Go.Board
Godash port to elixir godash url: https://github.com/duckpunch/godash
Avril 2017, hf
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. If You want to clone from an existing structure, transform to a map firstby using
Pass move. Not in original godash!
Place one stone on the board
Remove the stone at the given location
Reset. Not in original godash!
Resign. Not in original godash!
Returns list from board
Generate an ascii board
Like pass move, but does not change history state. Not in original godash!
Types
Functions
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
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.
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
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. If You want to clone from an existing structure, transform to a map firstby using :
initial_state |> Map.from_struct |> Go.Board.new
Pass move. Not in original godash!
place_stone(t, coordinate, color, boolean) :: {:ok, t} | {:error, String.t}
Place one stone on the board.
place_stones(t, list_of_coordinates, color) :: {:ok, t} | {:error, String.t}
Remove the stone at the given location.
Returns list from board.
Generate an ascii board.