Good Form for Random Number Generator?
- by JackCJR
I wanted to get a few opinions on doing a random number generator. I read through a couple different ways to do it and this is the way that I created after doing a little reading. Is it acceptable form? Any foreseeable issues?
function master(){
function generate(){
var pickFrom= "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var j = pickFrom.length;
var i = Math.floor(Math.random()*j+1); //Generates a random number
var code = pickFrom.charAt(i) //Picks a number based on what number was picked.
document.write(code)
}
x = 1;
while(x){
generate();
x--;
}
}
master();