Make a deck of cards an actual tuple

db4
Aaron Schaefer 2009-05-06 21:44:25 -04:00
parent 83e7516666
commit 5e4e1ee48f
1 changed files with 6 additions and 2 deletions

View File

@ -194,8 +194,12 @@ M: hand equal?
: >value ( hand -- str )
hand-rank VALUE_STR nth ;
TUPLE: deck
{ cards sequence } ;
: <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 ;