Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!lll-crg!lll-lcc!ucdavis!ucbvax!hplabs!tektronix!teklds!zeus!tims From: tims@zeus.UUCP (Tim Stoehr) Newsgroups: net.sources.games Subject: rogue clone and random number generators Message-ID: <59@zeus.UUCP> Date: Mon, 17-Mar-86 13:06:46 EST Article-I.D.: zeus.59 Posted: Mon Mar 17 13:06:46 1986 Date-Received: Fri, 21-Mar-86 05:28:18 EST Distribution: net Organization: Tektronix, Beaverton OR Lines: 14 The rogue clone uses the 4.2 bsd pseudo-random-number generator, random(). The old familiar rand() does not suffice, for example: for (;;) { printf("%d, ", rand() % 4); } will generate: 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, . . . This is not good enough, to say the least. This may cause the rogue clone to get into an infinite loop when digging a maze as it tries random directions (an integer between 0 and 3), attempting to locate a room. Anyone running this code without the new UNIX random() routine will have to come up with a replacement for random() that works.