Pretty much explains it. Change the numRads variable to get different levels of randomness.
Use this code, not the source box one....
`Crazi random lines!
`By Joseph Thomson
`8/5/04
`Please include me in your credits if you use this code in any way
`Screen size
screenWidth as integer = 800
screenHeight as integer = 600
set display mode screenWidth,screenHeight,32
`Declare stuff
dotX as float
dotY as float
red as float
grn as float
blu as float
redSpd as float
grnSpd as float
bluSpd as float
`1 = spirograph style, increase for increasing randomness
numRads as integer = 6
lineThickness as integer = 5
`Arrays to store random values
dim rad(numRads) as float
dim radSpd(numRads) as float
dim radLow(numRads) as float
dim radHigh(numRads) as float
dim ang(numRads) as float
dim angSpd(numRads) as float
startAgain:
randomize timer()
cls
`Colours
red = rnd(255)
grn = rnd(255)
blu = rnd(255)
redSpd = rnd(100)*0.01
grnSpd = rnd(100)*0.01
bluSpd = rnd(100)*0.01
`Random value stuff
for x = 1 to numRads
`Radius change speed
radSpd(x) = (rnd(100)-50)*rnd(100)*0.0001
`Radius limits
radLow(x) = rnd(100)
radHigh(x) = radLow(x)+rnd(100)+100
`Starting radius
rad(x) = rnd(int(radHigh(x)-radLow(x)))+radLow(x)
`Starting angle
ang(x) = rnd(360)
`Angle speed
angSpd(x) = (rnd(100)-50)*rnd(100)*0.0001
next x
do
`Change values
for x = 1 to numRads
inc rad(x),radSpd(x)
if rad(x)<radLow(x) or rad(x)>radHigh(x)
radSpd(x) = -radSpd(x)
inc rad(x),radSpd(x)
endif
ang(x) = wrapvalue(ang(x)+angSpd(x))
next x
`Change colours
inc red,redSpd
if red < 0 or red > 255
redSpd = -redSpd
inc red,redSpd
endif
inc grn,grnSpd
if grn < 0 or grn > 255
grnSpd = -grnSpd
inc grn,grnSpd
endif
inc blu,bluSpd
if blu < 0 or blu > 255
bluSpd = -bluSpd
inc blu,bluSpd
endif
`Centre coordinates
dotX = screenWidth * 0.5
dotY = screenHeight * 0.5
`Conpile random values
for x = 1 to numRads
inc dotX,sin(ang(x)) * rad(x)
inc dotY,cos(ang(x)) * rad(x)
next x
`Draw dots!
lock pixels
for x = 1 to lineThickness
for y = 1 to lineThickness
newDotX = wrapvalue((dotX+x)/screenWidth*360)/360.0*screenWidth
newDotY = wrapvalue((dotY+y)/screenHeight*360)/360.0*screenHeight
dot newDotX,newDotY,rgb(red,grn,blu)
next y
next x
unlock pixels
`Start again is space is pressed
if spacekey() = 1
goto startAgain
endif
loop
Trying is the first step towards faliure.
Athelon XP 1600+/Radeon 9600 Pro/256 RAM