View Source Adventurous.Point (adventurous v0.1.12)

Link to this section Summary

Functions

Returnes coordinates of adjacent points

Converts num grid to array of ints

Moves Point coordinates by given values.

Prints point grid where map is a Map and every point has assigned integer value.

Reads array of integers and convers it into map of point->value and dimensions of grid.

Creates string representation of grid with marks (#) on given points. Blanks are filled with gap_char.

Link to this section Functions

Link to this function

adjacent(point, type \\ :direct)

View Source

Returnes coordinates of adjacent points

Link to this function

grid_to_string(map, width, height)

View Source

Converts num grid to array of ints

Link to this function

move(point, adjust_coords)

View Source
@spec move(
  atom() | %{:x => number(), :y => number(), optional(any()) => any()},
  map()
) ::
  %Adventurous.Point.Point2D{x: number(), y: number()}

Moves Point coordinates by given values.

@spec read_num_grid(binary()) :: {map(), non_neg_integer(), non_neg_integer()}

Reads array of integers and convers it into map of point->value and dimensions of grid.

Link to this function

string_grid_with_marks(points, arg, gap_char \\ ".")

View Source
@spec string_grid_with_marks(list(), {integer(), integer()}, binary()) :: binary()

Creates string representation of grid with marks (#) on given points. Blanks are filled with gap_char.