in reply to Randomize an array
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...
|
---|