Skip to content

Instantly share code, notes, and snippets.

@bendisposto
Created March 31, 2017 18:41
Show Gist options
  • Save bendisposto/b29bc47c60e7f4872b272a9e48525433 to your computer and use it in GitHub Desktop.
Save bendisposto/b29bc47c60e7f4872b272a9e48525433 to your computer and use it in GitHub Desktop.
(defn smax [& s]
(reduce
(fn [a e] (if (pos? (compare a e)) a e))
""
s))
(def fizzes (cycle ["" "" "fizz"]))
(def buzzes (cycle ["" "" "" "" "buzz"]))
(def nums (map (comp str inc) (range)))
(def fizzbuzz (map smax nums (map str fizzes buzzes)))
(take 100 fizzbuzz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment