home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Welt 1997 Hardware
/
HARDWARE.ISO
/
hardware
/
asbnch
/
source
/
random.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-11-27
|
231 b
|
15 lines
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
int init=0;
int random(int imax)
{
if (init==0)
srand( (unsigned)time( NULL ) );
init=1;
return (int)((rand()*((long)imax))/RAND_MAX);
}