[comp.os.minix] new rand.c

meulenbr@cstw01.UUCP (Frans Meulenbroeks) (11/21/88)

Hi!
I needed srand, so I added it to the minix/st rand.c
Here is the result. 
You'll need this for gnuchess

#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
-----cut here-----cut here-----cut here-----cut here-----
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	rand.c
# This archive created: Mon Nov 21 15:48:17 1988
sed 's/^X//' << \SHAR_EOF > rand.c
Xstatic long seed = 1L;
X
Xint rand()
X{
X  seed = (1103515245L * seed + 12345) & 0x7FFFFFFF;
X  return((int) (seed & 077777));
X}
X
Xint srand(val)
Xlong val;	
X{
X	seed = val;
X}
SHAR_EOF
#	End of shell archive
exit 0
-- 
Frans Meulenbroeks        (meulenbr@cst.prl.philips.nl)
	Centre for Software Technology
	( or try: ...!mcvax!philmds!prle!cst!meulenbr)
Newsgroups: comp.sys.minix
Subject: new rand.c
Expires: 
References: 
Sender: 
Reply-To: meulenbr@cst.UUCP ()
Followup-To: 
Distribution: world
Organization: Centre for Software Technology, Philips Eindhoven
Keywords: 

Hi!
I needed srand, so I added it to the minix/st rand.c
Here is the result.
You'll need this for gnuchess

#	This is a shell archive.
#	Remove everything above and including the cut line.
#	Then run the rest of the file through sh.
-----cut here-----cut here-----cut here-----cut here-----
#!/bin/sh
# shar:	Shell Archiver
#	Run the following text with /bin/sh to create:
#	rand.c
# This archive created: Mon Nov 21 15:48:17 1988
sed 's/^X//' << \SHAR_EOF > rand.c
Xstatic long seed = 1L;
X
Xint rand()
X{
X  seed = (1103515245L * seed + 12345) & 0x7FFFFFFF;
X  return((int) (seed & 077777));
X}
X
Xint srand(val)
Xlong val;	
X{
X	seed = val;
X}
SHAR_EOF
#	End of shell archive
exit 0
-- 
Frans Meulenbroeks        (meulenbr@cst.prl.philips.nl)
	Centre for Software Technology
	( or try: ...!mcvax!philmds!prle!cst!meulenbr)