Liking cljdoc? Tell your friends :D

advent-utils.grid


adj-coords-2dclj

(adj-coords-2d [x y] & {:keys [include-diagonals]})

Coordinates of adjacent points. If include-diagonals is not set or false, returns the four adjacent points (of the von Neumann neighborhood), always in the order N W S E. If include-diagonals is set to true, return the eight adjacent coordinates (of the Moore neighborhood)

Coordinates of adjacent points. If include-diagonals is not set or false, 
returns the four adjacent points (of the von Neumann neighborhood), 
always in the order N W S E. If include-diagonals is set to true,
return the eight adjacent coordinates (of the Moore neighborhood)
sourceraw docstring

Grid2Dcljprotocol

A two-dimensional grid of values

A two-dimensional grid of values

heightclj

(height this)

The total height of the grid (number of cells in the vertical direction)

The total height of the grid (number of cells in the vertical direction)

neighbors-4clj

(neighbors-4 this pos)

A map of the positions and values of the four nearest (von Neumann) neighbors of position pos

A map of the positions and values of the four nearest (von Neumann) neighbors of position pos

neighbors-8clj

(neighbors-8 this [x y])

A map of the positions and values of the eight nearest (Moore) neighbors, including diagonals, of position pos

A map of the positions and values of the eight nearest (Moore) neighbors, including diagonals, of position pos

sliceclj

(slice this dim idx)

A slice of the grid along dim (:row or :col) at index idx

A slice of the grid along dim (:row or :col) at index idx

valueclj

(value this pos)

The value of the grid at position pos

The value of the grid at position pos

widthclj

(width this)

The total width of the grid (number of cells in the horizontal direction)

The total width of the grid (number of cells in the horizontal direction)
sourceraw docstring

Grid2D->asciiclj

(Grid2D->ascii charmap grid2d)

Convert a Grid2D into an ASCII-art string representation.

charmap is a map where the keys are ASCII chars and the values are expected to be symbols to use in your application. Ex.: (def charmap {. :space # :wall})

Convert a Grid2D into an ASCII-art string representation.

charmap is a map where the keys are ASCII chars and
the values are expected to be symbols to use in
your application. Ex.: (def charmap {\. :space \# :wall})
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close