begin implementing a flf loader
This commit is contained in:
parent
7ee1aa478a
commit
4455bb6d65
|
@ -1,6 +1,16 @@
|
||||||
(ns clj-figlet.core)
|
(ns clj-figlet.core
|
||||||
|
(:import (java.io File))
|
||||||
|
(:require [clojure.string :as str]))
|
||||||
|
|
||||||
|
(defn- parse-flf-header [header-line]
|
||||||
|
(let [parts (str/split header-line #" ")]
|
||||||
|
{:hardblank (-> parts first last)
|
||||||
|
:height (Integer/parseInt (nth parts 1))
|
||||||
|
:num-comments (Integer/parseInt (nth parts 5))}))
|
||||||
|
|
||||||
|
(defn load-flf [file]
|
||||||
|
(let [lines (str/split (slurp file) #"\n")
|
||||||
|
header (parse-flf-header (first lines))
|
||||||
|
char-lines (drop (inc (:num-comments header)) lines)]
|
||||||
|
))
|
||||||
|
|
||||||
(defn foo
|
|
||||||
"I don't do a whole lot."
|
|
||||||
[x]
|
|
||||||
(println x "Hello, World!"))
|
|
||||||
|
|
Loading…
Reference in a new issue