random.c

dgd/src/host/mac/random.c · 312 B

From the archive dgd-1.2p4.tar.gz

Download the archive   « Back to the archive contents

# include <Quickdraw.h>
# include "dgd.h"

/*
 * NAME:	P->srandom()
 * DESCRIPTION:	set seed for random number
 */
void P_srandom(long s)
{
    qd.randSeed = s;
}

/*
 * NAME:	P->random()
 * DESCRIPTION:	generate "random" number
 */
long P_random(void)
{
    return (Random() + Random() * 32768) & 0x7fffffff;
}

Site Stats

Snippets: 1791
Codebases: 571