Staging
v0.5.1
v0.5.1
Revision 9897f0f847b1107f897862602531d5f78112d7fb authored by Guido van Rossum on 21 December 1997, 06:46:20 UTC, committed by Guido van Rossum on 21 December 1997, 06:46:20 UTC
but other compilers don't like.
1 parent 8b0d95f
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 ...