table = PokerTable.new ante: 5, deck: "2C 3C 2S 4C 2H 5C 2D 8C 9C 10C 4S 5S 6S 8S", players: [ { id: "Robert", stack: 15}, { id: "Person", stack: 15} ] table.simulate! [ { player_id: "Robert", action: "bet", amount: 6 }, { player_id: "Person", action: "bet", amount: 6 } ] table.round == 'draw' table.current_player[:id] == "Robert" table.valid_action?(player_id: "Person", action: "bet", amount: 6) # => false table.valid_action?(player_id: "Robert", action: "replace", cards: ["9C"]) # => true table.simulate! [ { player_id: "Robert", action: "replace", cards: ["9C"] } ]
forked from rnubel/poker_table
-
Notifications
You must be signed in to change notification settings - Fork 0
umtrey/poker_table
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
In-memory simulation of a draw poker hand.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Ruby 100.0%