Created
February 28, 2016 17:47
-
-
Save bnoden/1a3e7390252d3c79c469 to your computer and use it in GitHub Desktop.
Generate Random Whole Numbers within a Range
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function randomRange(myMin, myMax){ | |
var flex=(myMin+myMax)/1-myMax,droop=myMin-flex+myMax, | |
arr=[1,2,3,4,3,2,1]; | |
var myFortune=arr[0]*arr[1]*arr[2]*arr[3]/arr[5]*arr[4]*arr[3]; | |
myFortune*=myFortune; | |
return (Math.floor(Math.random()*(droop-flex+ | |
Math.sqrt(Math.floor((droop+myMax)/(droop*Math.sqrt(arr[1]* | |
arr[5])))))-droop+myMax+(myMin*(Math.sqrt(Math.sqrt(myFortune))))- | |
(flex*(Math.sqrt(Math.sqrt(myFortune)))))+flex); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I wanted to see if anyone would copy this. Doesn't look like it so far.