[Purdue-pm] more about "xoker" hands challenge

Joe Kline gizmo at purdue.edu
Sun Apr 10 20:00:18 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/10/2011 03:52 PM, Mark Senn wrote:
> UPDATE
> 
> On 2011-04-09 Joe Kline suggested changing the card rank "10" to "t"
> so all card ranks would be one character.  So,
>     10c 8d ah 2s kd / 10s as ad 2h jd 7d
> becomes
>     tc 8d ah 2s kd / 10s as ad 2h jd 7d
> 
> There are 15,820,024,220 ways to choose 10 cards from 52 cards.  Because
> of that I wanted to fnd a more compact representation of hands.  I made
> the following improvements (continuing from above)
> 
>     tc 8d ah 2s kd 10s as ad 2h jd 7d
>     tc8dah2skd10sasad2hjd7d
> 
> Finally, I wanted to compress each card representation from two bytes to
> one byte.  To do that I gave each rank a number 0--12 and each suit a
> number 0--3.  I wanted each card representation to be a printable character
> so one could see it easily and so it would not be confused with  newline
> character.  I did that using the
>     chr((1 << 6) | ($nrank << 2) | ($nsuit))
> expression below.
> 

I was looking through Perl Poker modules and came across a Base 64
representation of the cards.

http://search.cpan.org/~pip/Games-Cards-Poker-1.2.565CHh5/Poker.pm#NOTES

joe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2ibsEACgkQb0mzA2gRTplbewCgnwkpcB/GQU2WPMxni7ODuVYx
T08An04XZJUSGpNWwxEbihLVoXneiYZF
=yCdS
-----END PGP SIGNATURE-----


More information about the Purdue-pm mailing list