-

Functions HI-TECH C SRAND

From HI-TECH C for CP/M Fan WIKI(EN)
Revision as of 23:52, 31 July 2017 by Kumokosi (talk | contribs) (Created page with "<strong>SRAND</strong> ==SYNOPSIS== #include <stdlib.h> void srand(int seed) ==DESCRIPTION== <strong>Srand</strong>() initializes the random number generator a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

SRAND

SYNOPSIS

#include  <stdlib.h>

void srand(int seed)


DESCRIPTION

Srand() initializes the random number generator accessed by rand() with the given seed. This provides a mechanism for varying the starting point of the pseudo-random sequence yielded by rand(). On the z80, a good place to get a truly random seed is from the refresh register. Otherwise timing a response from the console will do.

SEE ALSO

rand