Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uflorida!ziggy!screamer!stelmack From: stelmack@screamer.csee.usf.edu (Gregory M. Stelmack) Newsgroups: comp.sys.amiga Subject: Re: Lattice Random Numbers Message-ID: <49@screamer.csee.usf.edu> Date: 23 Sep 90 16:31:58 GMT References: <4604@crash.cts.com> Followup-To: comp.sys.amiga Organization: University of South Florida, Department of Computer Science and Engineering Lines: 22 In article <4604@crash.cts.com> acota@pro-realm.cts.com (Arnold Cota) writes: >How do I generate a random number in the range of 1 to 54 in Lattice C? > I'll post here since my reply bounced, and others may be interested. srand(time(NULL)); /* seed random number generator */ int min,max; min = 1; max = 54; int x=0; x = rand()%max+min; See p. L168 of the Lattice manual. -- Greg Stelmack -- Email: stelmack@sol.csee.usf.edu -- USmail: USF Box 1510, Tampa, FL 33620-1510 -- Amiga: the only way to compute!