Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ukma!uflorida!novavax!infocenter!mhoffman From: mhoffman@infocenter.UUCP (Mike Hoffman) Newsgroups: comp.sources.games.bugs Subject: slot machine simulator time() problem Message-ID: <1790@infocenter.UUCP> Date: 22 Mar 89 13:57:32 GMT Organization: Gould CSD, Fort Lauderdale, FL Lines: 26 In getting "bandit" to work on our system, I ran across a problem in the init_rand() function. Seems that our system requires time(3) to have an argument of 0. Without it, everything compiled fine, but when run, I got "illegal instruction - core dumped." Changing time() to time(0) seemd to fix it. We are running UTX/32 2.1a, Gould's 4.3BSD O/S. There is a note in the man page that indicates that time(3) is made obsolete by gettimeofday(2). Here is how init_rand looks now: void init_rand() { u_32 z; z = time(0); /* WAS: z = time(); */ srandom(z); } Incidentally, I played a few times and lost all my money quickly, and only had one "winner", which paid 2-1. Just bad luck? :-) ----------------------------------------------------------------- Mike Hoffman ...!novavax!gould!mhoffman