Last change
on this file since 28 was
2,
checked in by Sam Hocevar, 18 years ago
|
- imported original 0.7.0 tarball
|
File size:
371 bytes
|
Rev | Line | |
---|
[2] | 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.