Skip to content

Instantly share code, notes, and snippets.

@asimjalis
Forked from athos/deps.edn
Last active June 30, 2018 23:41
Show Gist options
  • Save asimjalis/8ea6121fa652001546c6d6cbd713e301 to your computer and use it in GitHub Desktop.
Save asimjalis/8ea6121fa652001546c6d6cbd713e301 to your computer and use it in GitHub Desktop.
Try `clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/asimjalis/8ea6121fa652001546c6d6cbd713e301" :sha "1c9a05106171f97f9b8e8ac8f58c7bd8dbe021f9"}}}' -m hello-clojure` on your terminal
{:paths ["."]
:deps {clansi {:mvn/version "1.0.0"}}}
(ns hello-clojure
(:require clansi
[clojure.java.io :as io]))
(def styles
{\b :bg-blue
\g :bg-green
\w :bg-white})
(defn colorize-line [line]
(->> line
(map #(clansi/style " " (get styles % :bg-default)))
(apply str)))
(defn -main []
(with-open [r (io/reader (io/resource "logo.dat"))]
(run! #(println (colorize-line %)) (line-seq r))))
-----------wwwwwwwwww-----------
---------wwwwwbbbbwwwww---------
-------wwwbbbbbbbbbbbwwww-------
------wwbbbbbbbbbbbbbbbwww------
-----wwbbbbbbbbbbbbbbbbbbww-----
----wwbbbbbbbbbbbbbbbbbbbbww----
---wwwwwwwwbbbbbbbbbbbbbbbbww---
--wwwwwwwwwwwwwwwwwbbbbbbbbbww--
--wwwwgggwwwwwbbbbwwwbbbbbbbww--
-wwwwggggwwgwwbbbbbbwwbbbbbbbww-
-wwwgggggwwggwwbbbbbbwwbbbbbbww-
wwwgggggwwgggwwbbbbbbbwwbbbbbbw-
wwgggggwwgggggwwbbbbbbbwbbbbbbww
wwgggggwwgggggwwbbbbbbbwwbbbbbww
wggggggwgggggggwbbbbbbbwwbbbbbww
wggggggwgggggggwbbbbbbbbwbbbbbww
wggggggwggggggwwwbbbbbbbwbbbbbww
wggggggwgggggwwgwbbbbbbwwbbbbbww
wwgggggwwggggwggwwbbbbbwwbbbbbww
wwggggggwgggwwggwwbbbbbwbbbbbbw-
-wggggggwwggwggggwwbbbwwbbbbbww-
-wgggggggwwgwggggwwbbwwbbbbbwww-
-wwgggggggwwwgggggwwwwbbbbwwww--
--wwgggggggwwwwggwwwwwwwwwwwww--
--wwgggggggggwwwwwwgggwwwwggw---
---wwggggggggggggggggggggggww---
----wwggggggggggggggggggggww----
-----wwggggggggggggggggggww-----
------wwwggggggggggggggwww------
--------wwwggggggggggwww--------
----------wwwwwwwwwwww----------
-------------wwwwww-------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment