randomize poker decks in <deck> word
parent
82f57e57f9
commit
0d75418048
|
@ -13,4 +13,4 @@ HELP: best-holdem-hand
|
||||||
|
|
||||||
HELP: <deck>
|
HELP: <deck>
|
||||||
{ $values { "deck" sequence } }
|
{ $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." } ;
|
||||||
|
|
|
@ -183,7 +183,7 @@ PRIVATE>
|
||||||
|
|
||||||
: <deck> ( -- deck )
|
: <deck> ( -- deck )
|
||||||
RANK_STR SUIT_STR 2array
|
RANK_STR SUIT_STR 2array
|
||||||
[ concat >ckf ] V{ } product-map-as ;
|
[ concat >ckf ] V{ } product-map-as randomize ;
|
||||||
|
|
||||||
: best-holdem-hand ( hand -- n cards )
|
: best-holdem-hand ( hand -- n cards )
|
||||||
5 [ [ hand-value ] [ ] bi ] { } map>assoc-combinations
|
5 [ [ hand-value ] [ ] bi ] { } map>assoc-combinations
|
||||||
|
@ -198,9 +198,6 @@ PRIVATE>
|
||||||
: string>value ( string -- value )
|
: string>value ( string -- value )
|
||||||
parse-cards best-holdem-hand drop ;
|
parse-cards best-holdem-hand drop ;
|
||||||
|
|
||||||
: shuffle ( deck -- deck )
|
|
||||||
[ randomize ] change-cards ;
|
|
||||||
|
|
||||||
ERROR: no-card card deck ;
|
ERROR: no-card card deck ;
|
||||||
|
|
||||||
: draw-specific-card ( card deck -- card )
|
: draw-specific-card ( card deck -- card )
|
||||||
|
|
Loading…
Reference in New Issue