Mail Archives: djgpp/1998/01/30/06:31:44
Myknees wrote:
>
> You are just seeing me trying out new things. Is pc.h (getkey()) more portable
> than bios.h?
Not really, but you're probably more likely to find it on another DOS
compiler. :-) getch() is even more portable; nearly every DOS compiler
has a conio.h. All forms of non-stdio interface are non-ANSI, however,
so you won't find any of those on a non-DOS compiler. Feel free to use
whatever you want, of course, but your program is easier for others to
undertand if you use quasi-"standard" functions. :-)
> Fair enough, but cross references are an easy enough shortcut if there isn't
> time for explanation. And mentioning that rand() must be seeded hardly
> constitutes a tutorial.
You are absolutely right. I'll check the docs before v2.02 is released
to be sure these made it in there.
>
> --Ed (Myknees)
>
> Here's how I see what you were talking about:
That's right. Since the granularity of time() is usually one second,
any code that iterates more frequently than that will generate the
"same" random numbers. :-)
--
---------------------------------------------------------------------
| John M. Aldrich |"A competent and self-confident person|
| aka Fighteer I | is incapable of jealousy in anything.|
| mailto:fighteer AT cs DOT com | Jealousy is invariably a symptom of |
| http://www.cs.com/fighteer | neurotic insecurity." - Lazarus Long|
---------------------------------------------------------------------
- Raw text -