SHARE
TWEET

rngsched

phillip1882 Jul 30th, 2013 97 Never
  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))
RAW Paste Data
Top