Created
January 1, 2012 17:23
-
-
Save bsteuber/1547828 to your computer and use it in GitHub Desktop.
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 fullhouse3 [hand] | |
(let [index (->> hand | |
(group-by :rank) | |
vals | |
(sort-by (fn [same] [(count same) | |
(:rank (first same))] | |
>))) | |
[fst snd] index] | |
(when (and (= (count fst) 3) | |
(>= (count snd) 2)) | |
(concat fst (take 2 snd))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment