Card shuffles: Difference between revisions
m
→{{header|Raku}}: Undo bizarre single space indent that somebody found necessary to do. Remove obsolete use v6.0;
Thundergnat (talk | contribs) m (Automated syntax highlighting fixup (second round - minor fixes)) |
Thundergnat (talk | contribs) m (→{{header|Raku}}: Undo bizarre single space indent that somebody found necessary to do. Remove obsolete use v6.0;) |
||
Line 1,978:
(formerly Perl 6)
<syntaxhighlight lang="raku" line>sub overhand ( @cards ) {
my @splits = roll 10, ^( @cards.elems div 5 )+1;
@cards.rotor( @splits ,:partial ).reverse.flat
my @pile2 = @pile.splice: @pile.elems div 2 ;
Line 1,993 ⟶ 1,990:
@pile2.rotor( (1 .. 3).roll(9), :partial ),
).flat
my @cards2 = ^20;▼
@cards2.=&riffle for ^10;▼
say @cards2;▼
say (^20).pick(*);▼
=={{header|REXX}}==
A little extra effort was put into the '''create''' subroutine to build any sort of deck, even a multiple deck as in canasta and samba (with/without jokers). Adding options for short decks, pinochle, schmear, six-handed '''500''', and the like would be prohibitive and muddy up the code and be distracting.
|