I have been beating my head against the wall and just can't seem to get the function correct. I am using the pick a number generator
!pickanumber $(eval Math.floor((Math.random() * 10) +1))
just a pick a number simple enough but I need it to return if/then and just can't get it.
Example: !pickanumber 10 (return YOU ARE CORRECT!) if the output matches the user input and (Sorry Try Again) if the number is incorrect. I just can't get the code right. Any help would be greatly appreciated.
!pickanumber 8
Nightbot:The number is 8 YOU ARE CORRECT
!pickanumber 5
Nightbot The Number is 7 Sorry Try Again
Thanks -JTS
/e I have been trying to work with this code but still not quite what I am looking for I need it to check against the user input if == then A if not then respond B
!NAME $(eval var a = (Math.floor(Math.random() * 100)); if (a>99) { var b = ' 100 Test '; b; } else { var b = ' Less than 99 '; b; } )