Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!ccwf.cc.utexas.edu From: lshaw@ccwf.cc.utexas.edu (logan shaw) Newsgroups: comp.sys.amiga.tech Subject: Re: rand() within a range. Message-ID: <41267@ut-emx.uucp> Date: 12 Dec 90 19:08:31 GMT References: <666@sheoak.bcae.oz> Sender: news@ut-emx.uucp Reply-To: lshaw@ccwf.cc.utexas.edu (logan shaw) Organization: The University of Texas at Austin Lines: 17 In article <666@sheoak.bcae.oz> 737104@sheoak.bcae.oz (David Thiele) writes: >Is there a way to generate random numbers within a certain range in >Lattice C??. ... Well, assuming you are already writing an amiga specific application and this won't hurt portability, you could use the amiga.lib function rangerand(). You pass it a longword (with a value from 1 to 65535) and it returns a random number between 0 and that number. If you are being portable, use a macro. Hope that helps... -- =----------------Logan-Shaw---(lshaw@ccwf.cc.utexas.edu)----------------= "Trust in the Lord with all thine heart, and lean not on thine own understanding. In all thy ways acknowledge Him and he shall direct thy paths" - Proverbs 3:5-6