Created
May 15, 2015 13:20
-
-
Save tfrisk-old/27ba1ef9b59316aaaa94 to your computer and use it in GitHub Desktop.
Revisions
-
tfrisk created this gist
May 15, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ ; --------------------------------------------------- ; https://github.com/ClojureBridge/curriculum/blob/master/outline/flow_control.md (defn ordinal [n] (let [r (rem n 10)] (if (and (> n 10) (< n 15)) (str n "th") (if (= r 1) (str n "st") (if (= r 2) (str n "nd") (if (= r 3) (str n "rd") (str n "th"))))))) (ordinal 1) (ordinal 2) (ordinal 3) (ordinal 4) (ordinal 5) (ordinal 10) (ordinal 11) (ordinal 12) (ordinal 13) (ordinal 14) (ordinal 15) (ordinal 21) (ordinal 22) (ordinal 23) ; ---------------------------------------------------