chess_logic v0.2.0 ChessLogic.Game
Documentation for Game.
The main entity,
April 2018, klg
Link to this section Summary
Functions
Set the result to draw
Import pgn into a game
Returns a new game
Play a move. a move looks like “e2e4”
Resign a game
Set result of the game
Export the move list history to pgn string
Link to this section Types
Link to this section Functions
Set the result to draw.
Import pgn into a game.
Link to this function
new()
Returns a new game.
Examples
iex> alias ChessLogic
iex> game = Game.new()
iex> {:ok, game} = game |> Game.play("e2e4")
iex> {:ok, game} = game |> Game.play("c7c5")
iex> game.current_position.fen
"rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
Play a move. a move looks like “e2e4”.
Resign a game.
Set result of the game.
Export the move list history to pgn string.