#ifndef _DICE_H_b10b5488_ #define _DICE_H_b10b5488_ /* * APIs exported by dice.c. These give the rest of the game convenient * access to randomness. */ /* * Three ways of getting random numbers. * * onein(N) returns true with probability 1/N, false with (N-1)/N. * * rnd(N) returns a random integer in [0..N). * * roll(dice) rolls dice based on a descriptive string, as in "d8" or * "4d3+7" or "d10+d12-1". */ extern int onein(int); extern int rnd(int); extern int roll(const char *); /* * Initialize randomness. Called once at startup. */ extern void initrandom(void); #endif