hi, i’m generating two random numbers, between 1 and 4, which must be different to each other each the two numbers are picked. i’ve tried the following: var firstRandom = Math.random()*3+1;
var secondRandom = Math.random()*3+1;
var boxA = “box”+(Math.round(firstRandom));
var boxB = “box”+(Math.round(secondRandom));
if (firstRandom == secondRandom) {
var secondRandom = Math.random()*3+1;
var boxB = “box”+(Math.round(secondRandom));
} else…
and i still get two numbers the same occasionally. why isn’t it comparing the numbers? is there a better way to achieve this? thanks in advance.