chiark / gitweb /
The Windows RNG turns out to only give about 16 bits at a time. This
[sgt-puzzles.git] / misc.c
diff --git a/misc.c b/misc.c
index 48088da140d3edb011222511bdff33cbd6150f24..73b9a7ba48097e1647ef9bbb75623fe0828b1478 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -7,23 +7,6 @@
 
 #include "puzzles.h"
 
-int rand_upto(int limit)
-{
-    unsigned long divisor = RAND_MAX / (unsigned)limit;
-    unsigned long max = divisor * (unsigned)limit;
-    unsigned long n;
-
-    assert(limit > 0);
-
-    do {
-        n = rand();
-    } while (n >= max);
-
-    n /= divisor;
-
-    return (int)n;
-}
-
 void free_cfg(config_item *cfg)
 {
     config_item *i;