[R] poker package -- comments?

Duncan Murdoch murdoch at stats.uwo.ca
Mon Nov 14 15:04:41 CET 2005


On 11/14/2005 7:39 AM, Dan Bolser wrote:
> Duncan Murdoch wrote:
>> Over the weekend I wrote a small package to evaluate poker hands and to 
>> do some small simulations with them.  If anyone is interested in looking 
>> at it, I'd appreciate comments and/or contributions.
> 
> How do I install this package?

It depends on which version of R you're running, but on windows, you
just download the zip file, and then in R, choose "Install package from
local zip file".

By the way, I've rearranged the files on my web page, so if you need to
download it again you'll need to follow a few different links.  It still
starts at http://www.stats.uwo.ca/faculty/murdoch/software.

Duncan
> 
> A README or a hint on th webpage below would be great.
> 
> 
>> The package is available at 
>> http://www.stats.uwo.ca/faculty/murdoch/software.  (Look at the bottom 
>> of the list.)
>> 
>> So far only the Texas Hold'em variation has been programmed.  There's 
>> support for wild cards and fairly general schemes of putting together
>> hands for evaluation, so it wouldn't be too hard to add other games. 
>> There's no support for betting or simulating different strategies, but 
>> again, if you want to write that, it should be possible.
>> 
>> Here's a quick example, where I've asked it to simulate hands until it 
>> came up with one I won.  In the first case I start with a pair of aces 
>> and won on the first hand; in the second another player started with 
>> aces, and it took 7 hands to find me a winner.
>> 
>> poker> select.hand(pocket = card("Ah As"), players = 4)
>> Showing: 4H 3S 2D 6S 4C
>>    Rank Name Cards      Value
>> 1    1 Self AH AS   Two pair
>> 2    2    1 8S 3C   Two pair
>> 3    3    2 QD KH Pair of 4s
>> 4    4    3 8H 9D Pair of 4s
>> Would win  4  person game
>> Required 1 hand.
>> 
>> poker> select.hand(players = list(card("Ah As"), NULL, NULL))
>> Showing: AD 4H 7D 2C 8S
>>    Rank Name Cards       Value
>> 1    1 Self 6H 5H    Straight
>> 2    2    1 AH AS 3 of a kind
>> 3    3    2 AC 3C  Pair of As
>> 4    4    3 9D 6D      A high
>> Would win  4  person game
>> Required 7 hands.
>> 
>> Duncan Murdoch
>> 
>> ______________________________________________
>> R-help at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html




More information about the R-help mailing list