Last change
on this file since 483 was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
File size:
371 bytes
|
Rev | Line | |
---|
[49] | 1 | #ifndef __JRAND_HPP_ |
---|
| 2 | #define __JRAND_HPP_ |
---|
| 3 | |
---|
| 4 | #define RAND_TABLE_SIZE 1024 |
---|
| 5 | extern unsigned short rtable[RAND_TABLE_SIZE]; // can be used directly when |
---|
| 6 | extern unsigned short rand_on; // speed is of essence |
---|
| 7 | |
---|
| 8 | void jrand_init(); |
---|
| 9 | inline unsigned short jrand() { return rtable[(rand_on++)&(RAND_TABLE_SIZE-1)]; } |
---|
| 10 | #define jrandom(x) (jrand()%(x)) |
---|
| 11 | |
---|
| 12 | #endif |
---|
| 13 | |
---|
Note: See
TracBrowser
for help on using the repository browser.