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
The package can be installed by adding elixir_go
to your list of dependencies in mix.exs
:
def deps do
[{:elixir_go, "~> 0.2.0"}]
end
Available in Hex. Documentation.
Usage
See tests for sample usage.
iex> alias Go.{Game, Board}
iex> game = Game.new(%{size: 9})
iex> {:ok, game} = Game.add_move(board, {{2, 2}, :black})
iex> {:ok, game} = Game.add_move(game, {{3, 3}, :white})
iex> game.current_board |> Board.to_ascii_board |> IO.puts
+++++++++
+++++++++
++O++++++
+++X+++++
+++++++++
+++++++++
+++++++++
+++++++++
+++++++++