This is the revision history for shuffle in <matrix.org:#DYJOMClZbVOMHnzPQt:matrix.org>
factoid_id | subject | copula | predicate | author | namespace |
---|---|---|---|---|---|
9554 | shuffle | is | use the List::Util module, or perl -le 'sub shuffle{my $aref = shift;my $i;for($i = @$aref; --$i;){my $j = int rand($i + 1);@$aref[$j,$i] = @$aref[$i,$j];}}@array = qw(A 2 3 4 5 6);shuffle(\@array);print @array;' | altreus | <*:##NULL> |
32 | shuffle | is | use the Util::List module, or perl -le 'sub shuffle{my $aref = shift;my $i;for($i = @$aref; --$i;){my $j = int rand($i + 1);@$aref[$j,$i] = @$aref[$i,$j];}}@array = qw(A 2 3 4 5 6);shuffle(\@array);print @array;' | perlbot | <*:##NULL> |