randomize poker decks in <deck> word

db4
Doug Coleman 2009-12-07 19:28:11 -06:00
parent 82f57e57f9
commit 0d75418048
2 changed files with 2 additions and 5 deletions

View File

@ -13,4 +13,4 @@ HELP: best-holdem-hand
HELP: <deck>
{ $values { "deck" sequence } }
{ $description "Returns a vector containing a standard, unshuffled deck of 52 cards." } ;
{ $description "Returns a vector containing a standard, shuffled deck of 52 cards." } ;

View File

@ -183,7 +183,7 @@ PRIVATE>
: <deck> ( -- deck )
RANK_STR SUIT_STR 2array
[ concat >ckf ] V{ } product-map-as ;
[ concat >ckf ] V{ } product-map-as randomize ;
: best-holdem-hand ( hand -- n cards )
5 [ [ hand-value ] [ ] bi ] { } map>assoc-combinations
@ -198,9 +198,6 @@ PRIVATE>
: string>value ( string -- value )
parse-cards best-holdem-hand drop ;
: shuffle ( deck -- deck )
[ randomize ] change-cards ;
ERROR: no-card card deck ;
: draw-specific-card ( card deck -- card )