Created
April 21, 2017 16:51
-
-
Save iamahuman/a27fe331c1d629dd0ad40d1aa779ae59 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
def rand(seed): | |
new_seed = (0x343fd * seed + 0x269ec3) & ((1 << 32) - 1) | |
randval = (new_seed >> 16) & 0x7fff | |
return randval, new_seed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment