foreach $prise (@cartes) { $xmel = int (rand(9999)); $cartes[$i++] = $xmel . X . $prise; } @cartes= sort @cartes; $i=0; foreach $prise (@cartes) { $prise=~s/.*X//; $cartes[$i++]=$prise; }
BTW, it IS meant to shuffle a deck of cards...
In reply to Re: Randomize an array
by Zebu
in thread Randomize an array
by Zebu
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |