View Single Post
Old May 1st, 2007, 5:00 PM   #3
aggelos
Newbie
 
Join Date: May 2005
Posts: 16
Rep Power: 0 aggelos is on a distinguished road
Just read it. Apologies.. so...
<html><head><title>JavaScript programming</title></head>
<body>
<script language="javascript">

document.write("<H1>Lottery number selection</H1><br> ");

alert("Hi! are you ready for your lottery numbers");

document.write("Then let us get going");

how_many=window.prompt("How many sets of number do you require","0");
temp_storage = new Array(6)
for (j=0; j<how_many; j++)
{
document.write("<br>Set ", j+1," lottery number are ");
for (i=0; i<=6; i++)
temp_storage[i]=0;//
for (i=1; i<=6; i++)
{
num = Math.random();
num=(num*48)+1;
num=Math.round(num);
switch(num)
{
case temp_storage[0]:
i--;
break;
case temp_storage[1]:
i--;
break;
case temp_storage[2]:
i--;
break;
case temp_storage[3]:
i--;
break;
case temp_storage[4]:
i--;
break;
case temp_storage[5]:
i--;
break;
default : temp_storage[i-1]=num;
}
}
for (i=0; i<6; i++)
{
num=temp_storage[i];
document.write(num, " ");
}
}
</script></body></html>
is that right?
aggelos is offline   Reply With Quote