Skip to content

Instantly share code, notes, and snippets.

@bsteuber
Created January 1, 2012 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bsteuber/1547828 to your computer and use it in GitHub Desktop.
Save bsteuber/1547828 to your computer and use it in GitHub Desktop.
(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