's.graph8.bas nomainwin WindowWidth = 600 WindowHeight = 600 UpperLeftX = int((DisplayWidth - WindowWidth) /2) UpperLeftY = int((DisplayHeight - WindowHeight)/2) button #graph.b1, "Exit", [exit], LR, 35, 20 button #graph.b2, "Log", [type], LR, 85, 20 button #graph.b3, "Start", [do.it], LR, 300, 20 button #graph.b3, "Store Image", [save.image], LR, 205, 20 open "Spiral" for graphics as #graph #graph "trapclose [exit]" #graph "horizscrollbar off;vertscrollbar off" #graph "down" #graph "home" #graph "posxy CenterX CenterY" #graph "place "; CenterX; " "; CenterY / 2 t =1 wait [do.it] r =1 i =0 t =0 spur.number =1 +int( 5 *rnd(1)) pi =3.14159265 incr =rnd( 1) /3 mult =1 +rnd( 1) /3000 theta.inc =rnd( 1) /100 k =1 +5 *rnd(1) #graph "cls ; fill "; int( 255 *rnd( 1)); " "; int(255 *rnd( 1)); " "; int( 255 *rnd( 1)) while r <300*2^0.5 i =i +1 scan #graph, "size "; int( 2 +r/ k)' growth of 'blob' if t =0 then r =r +incr else r =r *mult end if r0 =min( r, 255) theta =theta +theta.inc select case spur.number case 1 #graph "color 255 "; int( r0); " "; int( r0) x1 =CenterX +r *cos( theta) y1 =CenterY +r *sin( theta) #graph "set "; x1; " "; y1 case 2 #graph "color "; int( r0); " "; int( r0); " 255" x1 =CenterX +r *cos( theta) y1 =CenterY +r *sin( theta) #graph "set "; x1; " "; y1 x1 =CenterX +r *cos( theta +pi *2 /2) y1 =CenterY +r *sin( theta +pi *2 /2) #graph "set "; x1; " "; y1 case 3 #graph "color "; int( r0); " 255 "; int( r0) x1 =CenterX +r *cos( theta) y1 =CenterY +r *sin( theta) #graph "set "; x1; " "; y1 x1 =CenterX +r *cos( theta +pi *2 /3) y1 =CenterY +r *sin( theta +pi *2 /3) #graph "set "; x1; " "; y1 x1 =CenterX +r *cos( theta +2 *pi *2 /3) y1 =CenterY +r *sin( theta +2 *pi *2 /3) #graph "set "; x1; " "; y1 case 4 #graph "color "; int( r0); " "; int( r0); " "; int( r0) x1 =CenterX +r *cos( theta) y1 =CenterY +r *sin( theta) #graph " set "; x1; " "; y1 x1 =CenterX +r *cos( theta +pi *2 /4) y1 =CenterY +r *sin( theta +pi *2 /4) #graph " set "; x1; " "; y1 x1 =CenterX +r *cos( theta +2 *pi *2 /4) y1 =CenterY +r *sin( theta +2 *pi *2 /4) #graph " set "; x1; " "; y1 x1 =CenterX +r *cos( theta +3 *pi *2 /4) y1 =CenterY +r *sin( theta +3 *pi *2 /4) #graph " set "; x1; " "; y1 case 5 #graph "color "; int( r0); " 0 "; int( r0) x1 =CenterX +r *cos( theta) y1 =CenterY +r *sin( theta) #graph "set "; x1; " "; y1 x1 =CenterX +r *cos( theta +1 *pi *2 /5) y1 =CenterY +r *sin( theta +1 *pi *2 /5) #graph " set "; x1; " "; y1 x1 =CenterX +r *cos( theta +2 *pi *2 /5) y1 =CenterY +r *sin( theta +2 *pi *2 /5) #graph "set "; x1; " "; y1 x1 =CenterX +r *cos( theta +3 *pi *2 /5) y1 =CenterY +r *sin( theta +3 *pi *2 /5) #graph "set "; x1; " "; y1 x1 =CenterX +r *cos( theta +4 *pi *2 /5) y1 =CenterY +r *sin( theta +4 *pi *2 /5) #graph "set "; x1; " "; y1 end select wend wait [type] if t =0 then t =1 #graph.b2, "Log" else t =0 #graph.b2, "Lin" end if wait [exit] close #graph end [save.image] #graph "flush" #graph, "getbmp drawing 1 1 500 500" bmpsave "drawing", "spiral" +str$( int( 100000 *rnd( 1))) +".bmp" wait