Path: chuka.playstation.co.uk!scea!greg_labrec@interactive.sony.com From: mperdue@iquest.net (Mario Perdue) Newsgroups: scea.yaroze.programming.gnu_compiler Subject: Re: Good value for seeding the RNG Date: Tue, 27 May 1997 10:46:18 GMT Organization: SCEA Net Yaroze News Lines: 24 Message-ID: <338ab971.31511710@205.149.189.29> References: <5mcp8h$shk3@scea> NNTP-Posting-Host: filter-hrtc1.nortel.net X-Newsreader: Forte Free Agent 1.1/32.230 On Mon, 26 May 1997 19:49:26 GMT, paulk@anon.nymserver.com (Paul Kearns) wrote: >..., I'm looking for a decent number to seed the random number generator >with. I've always used the real time clock when working with computers, but >there doesn't appear to be such a thing on the Playstation. > Paul, How are you planning to seed the random number generator? The only function I'm aware of is rand() and it's defined as: long rand( void ) so that won't work. Unless you've written your own random number generator, like I did in Spaceguy. I never bothered to seed it in that program. If I was worried about randomness I would probably re-seed the RNG every time a button was pressed. As a seed I would try using a tick counter or even the next generated random number. This technique has worked well for me in the past. It doesn't really help from a cold start though. Mario