Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!haven!purdue!decwrl!sun!pitstop!sundc!seismo!uunet!munnari!jkjl From: jkjl@munnari.oz (John Lim) Newsgroups: comp.sys.mac.programmer Subject: Re: Random help, please Message-ID: <2671@munnari.oz> Date: 6 Feb 89 02:04:47 GMT References: <69823DN5@PSUVM> Reply-To: jkjl@munnari.UUCP (John Lim) Organization: Comp Sci, Melbourne Uni, Australia Lines: 27 In article <69823DN5@PSUVM> DN5@PSUVM.BITNET writes: >Hi netlanders: > > I am working on a DA which needs some random numbers. My problem is that >I always get the same sequence. I have tried setting randSeed, but this You just cannot simply reset randSeed in C by : randSeed = TickCount(); because LSC thinks that randSeed is a DA global offset by A4 and not A5 (which is what u want). What you need to do is use some assembly to access randSeed. Sorry but i dont have my notes and docs here so i cant show it to you from memory. >doesn't seem to do anything (actually I set it before I call Random, then >save this value, then reset the original value, so that it won't mess up >an application). However, anything I do (including attempting a FOR loop >repeating for a somewhat random time (GetTimeDate + CountTicks), seems to >do nothing: I still get the same sequence. Why dont you use your own random number generator ? john