Guido van Rossum | c636014 | 1990-10-13 19:23:40 +0000 | [diff] [blame] | 1 | # Module 'rand' |
2 | |||||
3 | import whrandom | ||||
4 | |||||
5 | def srand(seed): | ||||
6 | whrandom.seed(seed%256, seed/256%256, seed/65536%256) | ||||
7 | |||||
8 | def rand(): | ||||
9 | return int(whrandom.random() * 32768.0) % 32768 | ||||
10 | |||||
11 | def choice(seq): | ||||
12 | return seq[rand() % len(seq)] |