/* PASSWORD GENERATOR 300 BY: WESLEY BLACK CODE REVISION 3.0 Probably as refined as I'm going to make it. I've already wasted too much time on this thing! */ //function: generates password function selectPass() { mchar = numchar.value; ndig = numdig.value; trace("mchar = "+mchar); trace("ndig = "+ndig); //generate digits rnum = Math.random(); multiplier = Math.pow(10, ndig); trace("multiplier = "+multiplier); theDigit = Math.ceil(multiplier*rnum); trace("theDigit = "+theDigit); //generate word if (cbox.selectedItem.label == "All Words") { sd = Math.floor(Math.random()*dictionaries.length); trace(sd); //randomly selects word, omitting the 0 index (since it's the name of the array) sw = Math.floor(Math.random()*dictionaries[sd].length-1)+1; trace(sw); theWord = dictionaries[sd][sw]; trace(theWord); if (theDigit != 1) { thePass = theWord+theDigit; } else { thePass = theWord; } trace(thePass); } else { sd = cbox.selectedIndex-1; trace(sd); //randomly selects word, omitting the 0 index (since it's the name of the array) sw = Math.floor(Math.random()*dictionaries[sd].length-1)+1; trace(sw); theWord = dictionaries[sd][sw]; trace(theWord); if (theDigit != 1) { thePass = theWord+theDigit; } else { thePass = theWord; } trace(thePass); } if (theWord.length>mchar) { selectPass(); } else { trace("success! "+thePass); setCase(); } } //function: sets case function setCase() { trace("setCase"); if (r1.selected == true) { trace("r1"); newPass = ""; for (n=0; n