freeCodeCamp icon indicating copy to clipboard operation
freeCodeCamp copied to clipboard

return (Math.floor(Math.random() * (9 - 0 + 1)) + 0) ;

Open kevintrogers opened this issue 11 years ago • 2 comments

Challenge http://freecodecamp.com/challenges/waypoint-generate-random-whole-numbers-within-a-range has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

This was my code, but I get the following error message

assert((function(){if(editor.getValue().match(/max/g).length >= 2 && editor.getValue().match(/min/g).length >= 2 && editor.getValue().match(/Math.floor/g) && editor.getValue().match(/Math.random/g)){return(true);}else{return(false);}})(), 'You should be using the function given in the description to calculate the random in number in a range');You should be using the function given in the description to calculate the random in number in a range

I am using the function given, so I am not sure what the problem is.

kevintrogers avatar Aug 27 '15 15:08 kevintrogers

That is not an error message. That is the test used against your code.

Please read: https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/How-to-get-help-when-you-get-stuck and https://github.com/FreeCodeCamp/FreeCodeCamp/wiki/Creating-a-New-Github-Issue

BerkeleyTrue avatar Aug 27 '15 15:08 BerkeleyTrue

@kevintrogers thanks for posting this issue! Note that your issue is a duplicate. For more information see https://github.com/FreeCodeCamp/FreeCodeCamp/issues/2671.

Please review the Guidelines for Contributing, thank you!.

bugron avatar Aug 27 '15 17:08 bugron