Created
June 8, 2012 09:42
-
-
Save abozhilov/2894743 to your computer and use it in GitHub Desktop.
LCG
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
var lib = { | |
/* | |
* PRNG - Linear congruential generator | |
* The random cycle is 2^32 | |
* @retuns {unsigned integer} Next random seed | |
*/ | |
rand : (function () { | |
var seed = new Date; | |
return function () { | |
seed = (seed * 69069 + 1) >>> 0; | |
return seed; | |
}; | |
})() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment