Created
July 10, 2014 15:32
-
-
Save rockBreaker/6f3f439319bbf05b0477 to your computer and use it in GitHub Desktop.
funky clojure code, i am bad at naming at formatting
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 value [hand] | |
(let [checkers #{[high-card? 0] [pair? 1] | |
[two-pairs? 2] [three-of-a-kind? 3] | |
[straight? 4] [flush? 5] | |
[full-house? 6] [four-of-a-kind? 7] | |
[straight-flush? 8]} | |
ita (fn [coll] (if ((first coll) hand) (second coll)))] | |
(apply max (filter (complement nil?) (map ita checkers))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment