simple (psuedo) random number generator
take two numbers
12
34
add
46
add 46 to last number (34)
80
add 80 to 46 (and discard any values over 100)
126=26
6
32
38
70
108=8
78
86
164=64
150=50
114=14
64
78
142=42
etc
this gives a more or less random number sequence that repeats every so often, how often it repeats is down to the values in the two starting seeds IIRC, if you want to try this out then here is the code to play with this simple algorythm
sync rate 0:hide mouse
startpoint:
print "enter a value (seed)"
input a
print "enter another value (seed2)"
input b
columns=0:rows=0
cls
sync on
repeat
c=a+b
if c>=100 then c=c-100
a=b
b=c
text columns,rows,str$(c)
columns=columns+25
if columns=650
columns=0
rows=rows+12
endif
until rows>420
do
if spacekey()
cls
sync off
goto startpoint
endif
sync
loop
cheers.
Mentor.
System spec : Pentium 3.0Ghz, 512MB DDR, 1x160Gb HD (using 2 overheats
), DVD RW/CD RW (all modes), multimedia front panel, 6 way surround sound, ATI radeon 9800 128mb.