Skip to content

Instantly share code, notes, and snippets.

@kanwei
Created April 15, 2013 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanwei/e2c0415eb118ee79e4f1 to your computer and use it in GitHub Desktop.
Save kanwei/e2c0415eb118ee79e4f1 to your computer and use it in GitHub Desktop.
(defn process-game
([lines] (process-game lines {}))
([lines game]
(if-let [[op & data] (first lines)]
(case op
("id" "version") (recur (rest lines) (assoc game op (first data)))
"info" (recur (rest lines) (assoc-in game [:info (first data)] (second data)))
(recur (rest lines) game))
game)))
(time (pmap process-game (extract-games (parse-csv (clojure.java.io/reader "2012WAS.EVN")))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment