in reply to Array Shuffle
sub shuffler{ foreach (@_){ do{$r = int(rand($#_+1)); }while ((($r == $c) ||($temp[$r]))); $temp[$r]= $_;$c++; } return @temp; }
Thatll do it for you for a 1 dimensional array
hope it is what you were looking for
Edited by planetscape - added code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Array Shuffle
by ambrus (Abbot) on Feb 28, 2006 at 21:46 UTC |