Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!mcsun!ukc!warwick!covpoly!csg019 From: csg019@cck.cov.ac.uk (-~=Zaphod=~-) Newsgroups: comp.sys.amiga.tech Subject: Re: Lattice BLink problem Message-ID: <1991Jan4.125841.22240@cck.cov.ac.uk> Date: 4 Jan 91 12:58:41 GMT References: <1990Nov22.133240.12613@gdr.bath.ac.uk> <1990Nov26.181340.17891@cck.cov.ac.uk> <16490@cbmvax.commodore.com> Organization: Coventry Polytechnic, Coventry, UK Lines: 35 In article <16490@cbmvax.commodore.com> jesup@cbmvax.commodore.com (Randell Jesup) writes: >In article <1990Nov26.181340.17891@cck.cov.ac.uk> csg019@cck.cov.ac.uk (Z*A*P*H*O*D) writes: >>I don't realy know much about C but you could link a module with the following >>assembly language program, this will return a psedo random number (it is in >>fact the current raster beam Y-position... >>you could use it if you are realy desperate... >> >>start >> move.b $dff006,random >> rts > > Unfortunately, that produces an extremely poor random number. First, >it's limited to 0-255, secondly certain values will never show up (due to >vblank interrupts, TOF stuff, etc eating all the cpu for those lines), >thirdly, the distribution of the numbers remaining will be uneven due to >PAL machines having more than 256 lines, and NTSC having less. > > Just Say No. I know its a lame way thats why i said only use if if you were desperate :) I think you'll probably have to look it up in a maths book, there is a way of getting a pseudo random number by using LOG's and other mathmatical stuff, but i'm not so hot on that side of things..... I suppose you could mesure how long it takes AmigaDOS to corrupt a disk, thats VERY random number. -- *********/// O O **A member of S.H.I.T. (Super High Intelegence Team)**///*** * /// u Fight, defeat and kill organized laming. /// * * \\\ /// --- Zaphod (TCC) csg019@uk.ac.cov.cck ok? \\\ /// * ****\\X//**********************************************************\\X//******