Set, the card game: Difference between revisions
m
→{{header|Raku}}: simplify
Thundergnat (talk | contribs) m (→{{header|Raku}}: simplify) |
|||
Line 465:
<syntaxhighlight lang="raku" line>my @attributes = <one two three>, <solid striped open>, <red green purple>, <diamond oval squiggle>;
sub face ($_) { .polymod(3 xx 3).kv.map({ @attributes[$^k;$^v] }) ~ ('s' if $_%3
sub sets (@cards) { @cards.combinations(3).race.
▲ @cards.combinations(3).race.map: { (sum ([Z+] $_».polymod(3 xx 3)) »%» 3) ?? (next) !! $_ }
for 4,8,12 -> $deal {
|