I can’t get the random number generator to work on this password generator.
function randomnum()
{
Math.floor((Math.random() * 100) + 1);
}
function randomVerb()
{
let verb = [
"run",
"jump",
"walk",
"sit",
"play",
"dance",
];
return verb[Math.floor(Math.random() * verb.length)];
}
function randomEmotion()
{
let Emotion = [
"glad",
"joy",
"mad",
"confussed",
"sad",
"happy",
];
return Emotion[Math.floor(Math.random() * Emotion.length)];
}
function randomNoun()
{
let nouns = [
"dog",
"cat",
"house",
"table",
"picture",
"chair",
];
return nouns[Math.floor(Math.random() * nouns.length)] + "s";
}
let count = 3;
for (let i = 0; i < count; i++) {
let Password = randomNoun() + randomEmotion() + randomVerb() + randomnum();
console.log(Password);
}
I am trying to generate 3 passwords. but can not get the random number generator to work.
any help would be much appreciated. ia the momment it is not working. But I’m not sure why.