diff options
Diffstat (limited to 'sudoku.h')
-rw-r--r-- | sudoku.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sudoku.h b/sudoku.h new file mode 100644 index 0000000..a7309d2 --- /dev/null +++ b/sudoku.h @@ -0,0 +1,24 @@ +/* + * Sudoku: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id: sudoku.h 11 2005-10-28 01:00:01Z tom $ + */ + +#ifndef VDR_SUDOKU_H +#define VDR_SUDOKU_H + + +#ifdef USE_RAND +#include <stdlib.h> +#include <time.h> +/** Random number 0 .. max-1 */ +static unsigned int rand(unsigned int max) +{ + static unsigned int seed = time(NULL); + return (unsigned int)((double)max * rand_r(&seed) / (RAND_MAX + 1.0)); +} +#endif // USE_RAND + +#endif // VDR_SUDOKU_H |