Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (14 sloc) 301 Bytes
defmodule Board.Map2D do
@behaviour Board
def new do
0..8
|> Enum.map(fn x ->
{x, 0..8 |> Enum.map(fn y -> {y, nil} end) |> Map.new()}
end)
|> Map.new()
end
def get(board, x, y), do: board[x][y]
def set(board, x, y, value) do
put_in(board[x][y], value)
end
end
You can’t perform that action at this time.