Skip to content

Scala library for resolving texas holdem combinations

License

Notifications You must be signed in to change notification settings

zella/poker-combinations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

poker-combinations

Scala library for resolving texas holdem combinations

Usage

Argument 1: Map of players identifiers and their cards

val playersAndCards = Map[String, Seq[ICard]](
  "1" -> Seq(Card(Heart, A), Card(Diamond, K)),
  "2" -> Seq(Card(Heart, N(10)), Card(Diamond, N(10))),
  "3" -> Seq(Card(Club, Q), Card(Diamond, J)),
  "4" -> Seq(Card(Diamond, A), Card(Heart, K)),
  "5" -> Seq(Card(Diamond, N(2)), Card(Spade, N(2)))
)

Argument 2: Table cards

val tableCards = Seq(
  Card(Heart, N(2)),
  Card(Heart, N(3)),
  Card(Spade, N(10)),
  Card(Heart, J),
  Card(Club, N(9))
)


val resolver = CombinationResolver[String]() //thread safe instance

val computed: Seq[(String,Combination)] = resolver.resolve(playersAndCards, tableCards)`

returns sequens of all players combinations.

Where String - YourPlayerIdType

Combination -

cards - 5 cards  
combination - cards that reflects combination type. Ex: if [KKQQ7] then combiantion = [KKQQ]  
weight - weight in `Long`

About

Scala library for resolving texas holdem combinations

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages