Staging
v0.8.1
v0.8.1
Revision ca1182b262fcda35a8d75d0903b9d1966cf904ad authored by Fred Drake on 18 July 1997, 20:44:22 UTC, committed by Fred Drake on 18 July 1997, 20:44:22 UTC
1 parent d2b9f81
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 ...