Name: Anonymous 2011-02-12 6:10
Fibonacci in Perl6.
Can your toy language do this?
my @fib := (0, 1, *+* ... *);Can your toy language do this?
my @fib := (0, 1, *+* ... *);my@d=((<♦ ♠ ♥ ♣>X~(2..10,<J Q K A>))Z=>[2..9,10 xx 4,1|11]).pick(*);my@p=[],[];sub a{@^c.push(@d.pop)};sub b{[+]@^c».value};for@p {.&a;.&a;say '-'x 33;loop {if .&b!<22 {"{$_».key} > 21".say;last};say .&b,"\n{$_».key}";last if prompt('(h)it (s)it? ')~~'s';.&a}};say 'Winner:'~ %([max]@p.grep({.&b<22})).keys