Skip to content

Instantly share code, notes, and snippets.

@humorless
Forked from athos/deps.edn
Created April 26, 2018 02:59
Show Gist options
  • Save humorless/2f42b1bc910a2e2181728de9702e2b65 to your computer and use it in GitHub Desktop.
Save humorless/2f42b1bc910a2e2181728de9702e2b65 to your computer and use it in GitHub Desktop.
Try `clojure -Sdeps '{:deps {hello-clojure {:git/url "https://gist.github.com/athos/b68b15b08efedffaf14d8c020b125202" :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