blob: 06164833284faaca8abb6043d8d4e38bbeb92cee [file] [log] [blame]
Guido van Rossumc6360141990-10-13 19:23:40 +00001# Module 'rand'
2
3import whrandom
4
5def srand(seed):
6 whrandom.seed(seed%256, seed/256%256, seed/65536%256)
7
8def rand():
9 return int(whrandom.random() * 32768.0) % 32768
10
11def choice(seq):
12 return seq[rand() % len(seq)]