Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

rngsched

By: phillip1882 on Jul 30th, 2013  |  syntax: Python  |  size: 0.36 KB  |  views: 92  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import sys
  2. seed = 1589054912
  3. v = [seed]*4
  4. def rng2():
  5.    v[0] = (v[0]+(1<<31) +(7<<15) +(63<<8))&4294967295
  6.    v[1] = ((v[2]+v[3])+(v[0]^v[1]))&4294967295
  7.    v[2] = v[1]|v[v[3]&3]
  8.    v[3] = ((v[0]+v[1]+v[2])-v[3])&4294967295
  9.    return v[3]
  10.  
  11.  
  12. def schedule(people):
  13.     ary = list(range(0,people))
  14.     while 0 < len(ary):
  15.        print ary.pop(rng2()%len(ary))
clone this paste RAW Paste Data