Re: [OT] Quick Sort and a randomized hoare partition

Dennis <[email protected]> Sat, 24 Sep 2005 21:51:04 -0500 (CDT)
Newsgroups gmane.games.devel.mud.rom
Message-ID <[email protected]>
On Sat, 24 Sep 2005 [email protected] wrote:

> This is a bit off topic but a few of us my find this interesting, or useful! I'm
> pretty much stuck on this one. And here it is...

...

> Note 3: I need to implement the better way of generating random numbers.

...

> //this generates a random number from min to max.
> int generate_random_number(int min, int max)
> {
>        int i;
>        int num;
>
>        num  = rand() % (max -min + 1);
>
>        return num;
>
> }

If by "better", you mean one that works, that's where I'd start.

Dennis

-- 
ROM mailing list
[email protected]
Unsubscribe here ->>> http://www.rom.org/cgi-bin/mailman/listinfo/rom