Advertisement
nux95

randomness algorithm

Jun 30th, 2011
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. # randomness algorithm by niklas rosenstein
  2. # not garantueed to be really random
  3. #-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
  4.  
  5. from time import clock, time
  6.  
  7. def random(seed = None):
  8.   if seed is None:
  9.     seed   = clock() % 8294
  10.   tme      = ((time() ** 2) % seed) ** .3
  11.   return (tme / ((seed + 6) * 172
  12.     % (seed / 8))) % 1.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement