Skip to content

Instantly share code, notes, and snippets.

@shangaslammi
Created June 21, 2011 17:20
Show Gist options
  • Save shangaslammi/1038364 to your computer and use it in GitHub Desktop.
Save shangaslammi/1038364 to your computer and use it in GitHub Desktop.
Defining poker hands in Haskell using custom combinators
match High = 1 `with` same value
match Pair = 2 `with` same value
match TwoPair = 2 `with` same value `plus` 2 `with` same value
match ThreeOfKind = 3 `with` same value
match Straight = 5 `with` sequential value
match Flush = 5 `with` same suit
match FullHouse = 3 `with` same value `plus` 2 `with` same value
match FourOfKind = 4 `with` same value
match StraightFlush = 5 `with` same suit `and` sequential value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment