I'm using the eval comand to generate a random number between 1-100, and I want to make so that on an specific number, let's says 100, it says something diferent from the normal message. I have no experience with javascript so I don't know how does it work.
The command I'm using for the Ranfom Number Generator is this:
$(eval Math.floor((Math.random() * 100) + 1))
Eval Specific Result Conditions
7 replies
It works great, but I have 2 questions.
1.Is there a way to show the number that was generated?
2. I tried adding multiple conditions so that when you get, for example 100 it says nice!, but when you get 99 it says close one. I did it this way, but it didn't seem to work:
$(eval r=Math.floor(Math.random()*100+1);r==100?Nice!:Not Bad;r=99?Close One!:Not bad)
Didn't find your answer? The community is on Discord.
Ask on Discord