mirror of
https://github.com/danbee/chess
synced 2025-03-04 08:39:06 +00:00
Now we're only storing the pieces keyed by the piece position rather than storing the entire board as a set of nested Maps. This makes moving pieces much easier. We're also now storing the position as a pair of array indices which should make calculating the possible moves easier.
10 lines
160 B
Elixir
10 lines
160 B
Elixir
defmodule Chess.Api.GameView do
|
|
use Chess.Web, :view
|
|
|
|
alias Chess.Board
|
|
|
|
def render("show.json", %{game: game}) do
|
|
Board.output(game.board)
|
|
end
|
|
end
|