var i, rand, temp, str;
var nums = new Array(50)
for (i = 1; i < 51; i++) nums[i] = i;
for (i = 1; i < 51; i++)
{
rand = Math.ceil(Math.random() * 50);
temp = nums[i];
nums[i] = nums[rand];
nums[rand] = temp;
}
str = "Your six lucky numbers are:\n\n";
for (i = 1; i < 7; i++)
{
str +=nums[i];
if (i != 6)
{
str += " - "
}
}
alert (str);
1
Contributor
0
Replies
2
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.