Staging
v0.8.1
v0.8.1
Revision 99bbd18067083380b13a153c52fe342dbff21bc5 authored by cvs2svn on 12 October 1995, 10:34:31 UTC, committed by cvs2svn on 12 October 1995, 10:34:31 UTC
1 parent 0638b60
rand.py
# Module 'rand'
# Don't use unless you want compatibility with C's rand()!
import whrandom
def srand(seed):
whrandom.seed(seed%256, seed/256%256, seed/65536%256)
def rand():
return int(whrandom.random() * 32768.0) % 32768
def choice(seq):
return seq[rand() % len(seq)]
Computing file changes ...