Skip to content

Commit

Permalink
removes cell module and improves functions documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandrubagu committed Mar 12, 2024
1 parent 06c280d commit dfebaf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/grid.ex
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ defmodule Grid do
def put(grid, cell), do: %{grid | lookup: Map.put(grid.lookup, {cell.row, cell.column}, cell)}

@doc """
Returns a cell from the grid.
Returns a cell from the grid or nil if the cell does not exist.
"""
@spec get(t(), cell_position()) :: Cell.t()
def get(grid, cell_position), do: Map.get(grid.lookup, cell_position)

@doc """
Returns a neighbor of current cell position in the given direction.
Returns a neighbor of current cell position in the given direction or nil if the neighbor does not exist.
"""
@spec get_neighbor(direction(), cell_position(), t()) :: cell() | nil
def get_neighbor(direction, {row, column} = _current_cell, grid) do
Expand Down

0 comments on commit dfebaf1

Please sign in to comment.