Skip to content

Instantly share code, notes, and snippets.

@martinhynar
Created July 22, 2013 09:59
Show Gist options
  • Save martinhynar/6052730 to your computer and use it in GitHub Desktop.
Save martinhynar/6052730 to your computer and use it in GitHub Desktop.
(defn fibonacci-loop [n]
(loop [iter 0 fibs '()]
(cond
(= iter n) (reverse fibs)
(= iter 0) (recur (inc iter) (conj fibs 1))
(= iter 1) (recur (inc iter) (conj fibs 1))
:else (recur (inc iter) (conj fibs (reduce + (take 2 fibs))))
)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment