Make a deck of cards an actual tuple
parent
83e7516666
commit
5e4e1ee48f
|
@ -194,8 +194,12 @@ M: hand equal?
|
||||||
: >value ( hand -- str )
|
: >value ( hand -- str )
|
||||||
hand-rank VALUE_STR nth ;
|
hand-rank VALUE_STR nth ;
|
||||||
|
|
||||||
|
TUPLE: deck
|
||||||
|
{ cards sequence } ;
|
||||||
|
|
||||||
: <deck> ( -- deck )
|
: <deck> ( -- deck )
|
||||||
RANK_STR SUIT_STR 2array [ concat >ckf ] product-map ;
|
RANK_STR SUIT_STR 2array [ concat >ckf ] product-map deck boa ;
|
||||||
|
|
||||||
ALIAS: shuffle randomize
|
: shuffle ( deck -- deck )
|
||||||
|
[ randomize ] change-cards ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue