Quote:
Originally Posted by vwphillips
Code:
var Nus=[-1,-1,-1];
function newCard()
{
for (var i=0; i<1; i++)
{
var newNum = Math.floor(Math.random() * 9) + 1;
while (newNum==Nus[0]) newNum = Math.floor(Math.random() * 9) + 1;
Nus[0]=newNum;
document.getElementById("square" + i).innerHTML = newNum;
}
for (var i=9; i<10; i++)
{
var newNum = Math.floor(Math.random() * 9) + 1;
while (newNum==Nus[1]) newNum = Math.floor(Math.random() * 9) + 1;
Nus[1]=newNum;
document.getElementById("square" + i).innerHTML = newNum;
}
for (var i=18; i<19; i++)
{
var newNum = Math.floor(Math.random() * 9) + 1;
while (newNum==Nus[2]) newNum = Math.floor(Math.random() * 9) + 1;
Nus[2]=newNum;
document.getElementById("square" + i).innerHTML = newNum;
}
|
I replaced my text with what you wrote above and left the
window.onload = newCard;
at the very top of the code.
It still gives me the same results :-(