druss
01-17-2003, 10:49 PM
I am trying to print random letters on the html page however the problem is that i do not want the same letter apear more than once in the page.
Can someone tell me how to print out the alphabet in a random form without the letter being repeated?
My working progress is below
-----------------------------------
@alpha2 = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
for ($i = 0; $i <= 25; $i++) {
$ran = rand($#alpha2);
$test[$i] = $alpha2[$ran];
$l = 0;
foreach $slot (@alpha2) {
if($slot ne $alpha2[$l]) { $alpha2[$l] = $line; }
$l++;
}
}
-----------------------------------
Thanks a heap
Goran Sterjov
Can someone tell me how to print out the alphabet in a random form without the letter being repeated?
My working progress is below
-----------------------------------
@alpha2 = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
for ($i = 0; $i <= 25; $i++) {
$ran = rand($#alpha2);
$test[$i] = $alpha2[$ran];
$l = 0;
foreach $slot (@alpha2) {
if($slot ne $alpha2[$l]) { $alpha2[$l] = $line; }
$l++;
}
}
-----------------------------------
Thanks a heap
Goran Sterjov