Skip to content

Commit

Permalink
randomize poker decks in <deck> word
Browse files Browse the repository at this point in the history
  • Loading branch information
erg committed Dec 8, 2009
1 parent 37622f8 commit c975a3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion extra/poker/poker-docs.factor
Expand Up @@ -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." } ;
5 changes: 1 addition & 4 deletions extra/poker/poker.factor
Expand Up @@ -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
Expand All @@ -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 )
Expand Down

0 comments on commit c975a3c

Please sign in to comment.