We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 229c940 commit 8edad69Copy full SHA for 8edad69
bin/fish
@@ -149,8 +149,7 @@ sub fisher_yates_shuffle { # From The Perl Cookbook, recipe 4.17
149
my $i;
150
for($i=@$array; --$i;) {
151
my $j=int rand ($i+1);
152
- next if $i==$j;
153
- @$array[$i,$j]=@$array[$j,$i];
+ @$array[$i,$j] = @$array[$j,$i] if $i != $j;
154
}
155
156
@@ -180,8 +179,7 @@ if ($status=~/^y/i) {
180
179
print "Press <return>"; $status=<STDIN>;
181
182
183
-@DECK=split(//, 'A'x4 . 'K'x4 . 'Q'x4 . 'J'x4);
184
-foreach(1..4) {foreach(2..10) { push(@DECK, $_) } }
+@DECK = qw(A K Q J 10 9 8 7 6 5 4 3 2) x 4;
185
fisher_yates_shuffle(\@DECK);
186
187
foreach(1..7) {
0 commit comments