A83: Pseudo-Random #'s


[Prev][Next][Index][Thread]

A83: Pseudo-Random #'s




Has anyone here noticed how the r register sometimes loops and returns
the same random #'s?  Like in Fast Tunnel, if the tunnels right edge gets
near the right eddge of the screen and you hold down both arrow keys, the
tunnel loops?  Whoops, I let out  the secret to getting mega high ultra
tunnel scores :  )  It works

Anyway,  I was thinking if you did something like:


PseudoRand:
	ld	a,RandBase	; load a with RandBase #
	inc	a
	ld	RandBase,a	; Increment RandBase #
	add	30
	or	01101001b	; Do weird crap to the number
	rrc
	and	00011100b

RandBase:
 .db 35				; Write back the number so it's
not the same 				; each time you run the prog
				; Starting at 1 would be lame :  )

You'd have one weird number in a.  I'm sure someone could figure out a
formula using that kind of idea the produced numbers in no noticible
pattern.  This would work especially well in ZLib, where people run
different progs and the pattern would be even less noticible.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]