-
-
Save mmalone/ce523298670da66acaa1 to your computer and use it in GitHub Desktop.
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 MAX_RAND = Math.pow(2, 32); | |
var state = [seed(), seed()]; | |
var mwc1616 = function mwc1616() { | |
var r0 = (18030 * (state[0] & 0xFFFF)) + (state[0] >>> 16) | 0; | |
var r1 = (36969 * (state[1] & 0xFFFF)) + (state[1] >>> 16) | 0; | |
state = [r0, r1]; | |
var x = ((r0 << 16) + (r1 & 0xFFFF)) | 0; | |
if (x < 0) { | |
x = x + MAX_RAND; | |
} | |
return x / MAX_RAND; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bruh bro