Go
Description
This package contains logic to play the game of go. Nothing related to the go language… It is godash ported to elixir, but it checks also ko rule, and holds information about captures count.
Installation
If available in Hex, the package can be installed
by adding go
to your list of dependencies in mix.exs
:
def deps do
[{:elixir_go, "~> 0.1.0"}]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/go.
Usage
See tests for sample usage.
iex> alias Go.Board
iex> board = Board.new(%{size: 9})
iex> {:ok, board} = Board.add_move(board, {{2, 2}, :black})
iex> {:ok, board} = Board.add_move(board, {{3, 3}, :white})
iex> IO.puts Board.to_ascii_board board
+++++++++
+++++++++
++O++++++
+++X+++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++