Skip to content

Instantly share code, notes, and snippets.

@wvdlaan
Last active August 29, 2015 14:05
Show Gist options
  • Save wvdlaan/87e996d50270843f3b7f to your computer and use it in GitHub Desktop.
Save wvdlaan/87e996d50270843f3b7f to your computer and use it in GitHub Desktop.
(ns dojo.core
(:require [clojure.string :as str]))
(defn parse-line
[l]
(->> (take 3 l)
(map #(partition 3 %))
(apply map vector)))
(defn parse
[s]
(as-> (slurp s) x
(str/split x #"\r\n")
(partition 4 x)
(map parse-line x)))
(def definition
(map vector (parse "sample2.txt") (range)))
(def x (vec (parse "sample2.txt")))
(defn doit
[]
(parse "sample.txt"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment