Liking cljdoc? Tell your friends :D

advent-utils.ascii


ascii->mapclj

(ascii->map charmap lines)

Convert an ASCII represention of a 2D grid into a Clojure map.

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 codes {. :space # :wall})

Output will be a map with keys width, height, and grid. grid will be a map where the keys are [x y] positions and values will be the symbols defined in charmap

Convert an ASCII represention of a 2D grid into
a Clojure map.

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 codes {\. :space \# :wall})

Output will be a map with keys width, height, and grid.
grid will be a map where the keys are [x y] positions
and values will be the symbols defined in charmap
sourceraw docstring

map->asciiclj

(map->ascii charmap {:keys [width height grid]})

Convert a Clojure map representing a 2D space 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 codes {. :space # :wall})

Convert a Clojure map representing a 2D space 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 codes {\. :space \# :wall})
sourceraw docstring

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

× close