Created
February 9, 2012 15:42
-
-
Save mwmitchell/1780728 to your computer and use it in GitHub Desktop.
divisions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn divisions [n t] | |
(loop [nn n nt t z []] | |
(let [q (quot nn nt) nz (concat z [q])] | |
(if (> nt 1) | |
(recur (- nn q) (dec nt) nz) | |
nz)))) | |
(divisions 10 8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment