28 Aug, 2007
Generating numbers from 1 till 11 in random order
Posted by: Flashy In: Actionscript| Patarimai ir gudrybės
That was a big headcracker for several days. Im not a programmer, but the rule that “morning is smarter than evening”, and my programing language BASIC skills made nice combo, and i figured how to solve this problem.
random_eile=new Array(12);
for(a=1;a<12;a++){
exit_loop=0;
do{
random_eile[a]=random(11)+2;
t_exit=a;
for(b=0;b if(random_eile[a]<>random_eile[b]){t_exit=t_exit-1};
if(t_exit==0){exit_loop=1}
}}
while(exit_loop<>1)
}
So in this code, random_eile is an array, which members are numbers from 1 till 11. Their order is generated randomly everytime you run a script.
Fl.
