Skip to content

Instantly share code, notes, and snippets.

@ossareh
Created December 11, 2010 00:01
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 ossareh/737007 to your computer and use it in GitHub Desktop.
Save ossareh/737007 to your computer and use it in GitHub Desktop.
(defn pos-int-range [max]
;; rest drops leading 0
;; inc as range is not inclusive
(lazy-seq (rest (range (inc max)))))
(defn not-nil? [x] (not= nil x))
(defn hiphop [n]
(cond (> n 2)
(cond (and (zero? (mod n 15))) "Hop"
(zero? (mod n 3)) "Hoppity"
(zero? (mod n 5)) "Hophop")))
(map println (filter not-nil? (map hiphop (pos-int-range 15))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment