Perl 6 Perl 6 today #56

More cool stuff

my @suits  = < ♣ ♢ ♡ ♠ >;
my @ranks  = 2..10, < J Q K A >;

# concatenate each rank with each suit
my @deck = @ranks X~ @suits; 

my %points = @deck Z ((2..10, 10, 10, 10, 11) X+ (0,0,0,0));

# grab five cards from the deck
my @hand = @deck.pick(5);

# display my hand
say ~@hand;

# tell me how many points it's worth
say [+] %points{@hand};
Copyright © 2009
http://www.pmichaud.com/2009/pres/