Permalink
Browse files

randomize poker decks in <deck> word

  • Loading branch information...
1 parent 37622f8 commit c975a3c4f2ca835a3f4d6aaa00c7ba34299748ca @erg erg committed Dec 8, 2009
Showing with 2 additions and 5 deletions.
  1. +1 −1 extra/poker/poker-docs.factor
  2. +1 −4 extra/poker/poker.factor
@@ -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
@@ -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 )

0 comments on commit c975a3c

Please sign in to comment.