Message-ID: <32945672.DB3@pobox.oleane.com> Date: Thu, 21 Nov 1996 14:17:38 +0100 From: Francois Charton Organization: CCMSA MIME-Version: 1.0 To: Eli Zaretskii CC: djgpp AT delorie DOT com Subject: Re: Proper use of rand() References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eli Zaretskii wrote: > > This is a feature. All random functions return serias which can be > repeated exactly on the next run. Otherwise, people who run simulations > could not debug their programs and compare the results from different > runs. Other uses of this: in games : suppose you generate a maze, use of rand() with the same seed enable you to generate twice the same maze, while keeping it random-like (in "dungeon" games, this is useful : you can save one maze as just a number, and hence save a lot of storage...) in some picture generation programs, like raytracers : some functions such as those which generate clouds, bumps... use a random number generator. Using random series with the same seed enable to get the same image when you calculate it twice...