jonthequik
Programmer
I am wanting to set up a quiz that pulls 35 questions randomly from a list of 100 questions. Basically, I need to randomly generat 35 numbers from 0 - 100 and insure that none of them are duplicated.
Here's what I have so far:
function getRanNum() {
a = new Array(35);
for (i = 0; i < 35; i++) {
a = Math.round(Math.random()*100);
}
}
</SCRIPT>
Now, I need to runs some series of loops or something to cross-reference each number with the rest in the array and change it if it's already used...or something that works like that.
Jonathan
Here's what I have so far:
function getRanNum() {
a = new Array(35);
for (i = 0; i < 35; i++) {
a = Math.round(Math.random()*100);
}
}
</SCRIPT>
Now, I need to runs some series of loops or something to cross-reference each number with the rest in the array and change it if it's already used...or something that works like that.
Jonathan