19 lines
327 B
Text
19 lines
327 B
Text
/* BSD rand */
|
|
|
|
define rand() {
|
|
randseed = (randseed * 1103515245 + 12345) % 2147483648
|
|
return randseed
|
|
}
|
|
|
|
randseed = 1
|
|
rand(); rand(); rand(); print "\n"
|
|
|
|
/* Microsoft rand */
|
|
|
|
define rand() {
|
|
randseed = (randseed * 214013 + 2531011) % 2147483648
|
|
return randseed / 65536
|
|
}
|
|
|
|
randseed = 1
|
|
rand(); rand(); rand(); print "\n"
|