Skip to content

Instantly share code, notes, and snippets.

@iamahuman
Created April 21, 2017 16:51
Show Gist options
  • Save iamahuman/a27fe331c1d629dd0ad40d1aa779ae59 to your computer and use it in GitHub Desktop.
Save iamahuman/a27fe331c1d629dd0ad40d1aa779ae59 to your computer and use it in GitHub Desktop.
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