Tell us what’s happening:
So my fortune telling machine is doing what its supposed to do. It is giving me random fortunes which is nice so I am able to predict the future and what may come. However freecodecamp is not letting me pass and get to the next challenge. Please help and tell me what I am doing wrong.
Your code so far
let fortune1 = "You should avoid coffee at all cost unless you want to shit your pants infort of your crush.";
let fortune2 = "Dont go out after dark unless you want to run into a warewolf who will make you play chess for three hours straight.";
let fortune3 = "Be cautious of your new hemorrhoid cream you may get an allergic reaction.";
let fortune4 = "Your dog will poop inside your shoe. Be weary of where you stick your feet with out looking.";
let fortune5 = "It would be wise to avoid cherrys today unless you want to choke to death in your thirties.";
let max = 5;
let min = 1;
let randomNumber = Math.floor(Math.random() * (max - min + 1)) + min;
let selectedFortune = randomNumber
if (randomNumber === 1) {
console.log(fortune1);
} else if (randomNumber === 2) {
console.log(fortune2);
} else if (randomNumber === 3) {
console.log(fortune3);
} else if (randomNumber === 4) {
console.log(fortune4)
} else if (randomNumber === 5) {
console.log(fortune5)
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/145.0.0.0 Safari/537.36
Challenge Information:
Build a Fortune Teller - Build a Fortune Teller