Advertisement
phillip1882

rngsched

Jul 30th, 2013
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  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))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement