From 3cfd7b5bf6852f4a8f1f63707807bc1a269fc5df Mon Sep 17 00:00:00 2001 From: espie Date: Tue, 17 Dec 2002 21:25:06 +0000 Subject: [PATCH] the skew is not obvious, but it's better to write random generators this way... slightly more enjoyable, I think. --- games/circuit/patches/patch-circuit_c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 games/circuit/patches/patch-circuit_c diff --git a/games/circuit/patches/patch-circuit_c b/games/circuit/patches/patch-circuit_c new file mode 100644 index 00000000000..46e87e8a57a --- /dev/null +++ b/games/circuit/patches/patch-circuit_c @@ -0,0 +1,12 @@ +$OpenBSD: patch-circuit_c,v 1.3 2002/12/17 21:25:06 espie Exp $ +--- circuit.c.orig Tue Dec 17 21:20:16 2002 ++++ circuit.c Tue Dec 17 21:20:44 2002 +@@ -61,7 +61,7 @@ static GTimer *timer = NULL; + static unsigned + random_number(unsigned max) + { +- return(rand() % max); ++ return(rand()/(double)RAND_MAX * max); + } + + static unsigned