Re: number()

From: Daniel A. Koepke (dkoepke@circlemud.org)
Date: 02/18/02


On Mon, 18 Feb 2002, Sam Moggach wrote:

> i'm having problems with the number() function. I cannot figure out
> how to make it generate a random number each time it is called.

Ensure you are seeding the RNG with the srand() function.  If you seed the
randomizer with the same number, the progression will not differ.  Seed it
once at the beginning of the program, generally with something like:

  srand(time(0));

> i am making a small rpg in win32 API, [...]

Be very careful about including CircleMUD code into your projects (or not
doing clean-room implementations): it can make your work subject to the
CircleMUD (and, hence, DikuMUD) license.


-dak

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT