time1 = timerticks()
time2 = 0
win = openwindow ("Fractal Test",-1,-1,800,600)
setactivewindow (win)

textsize(2)
backcolor (100,140,180,255)

--cls()   
Pi2=6.28318 ; Type = 3 ; Count = 0 ; Count2 = 0
 Ang1 = Pi2/Type ; Ang = 0 ; x = 490 ; y = 580
 red = 100 ; green = 0 ; blue = 255
 color (255,0,0,255)

 function SetColor( clr )
         if( clr == 0 ) then
          red = 0 ; green = 0 ; blue = 0
         end
         if( clr == 1 ) then
          red = 255 ; green = 200 ; blue = 200
         end
         if( clr == 2 ) then
          red = 255 ; green = 0 ; blue = 0
         end
         if( clr == 3 ) then
          red = 255 ; green = 200 ; blue = 0
         end
         if( clr == 4 ) then
          red = 255 ; green = 255 ; blue = 0
         end
         if( clr == 5 ) then
          red = 0 ; green = 255 ; blue = 0
         end
         if( clr == 6 ) then
          red = 0 ; green = 0 ; blue = 255
         end
         if( clr == 7 ) then
          red = 255 ; green = 0 ; blue = 255
         end
         if( clr == 8 ) then
          red = 200 ; green = 200 ; blue = 200
         end
         if( clr == 9 ) then
          red = 255 ; green = 255 ; blue = 255
         end
         if( clr == 10 ) then
          red = 100 ; green = 100 ; blue = 100
         end
          if( clr == 11 ) then
          red = 200 ; green = 180 ; blue = 160
         end
          if( clr == 12 ) then
          red = 200 ; green = 0 ; blue = 0
         end
          if( clr == 13 ) then
          red = 200 ; green = 160 ; blue = 0
         end
          if( clr == 14 ) then
          red = 200 ; green = 200 ; blue = 0
         end
          if( clr == 15 ) then
          red = 0 ; green = 200 ; blue = 0
         end
          if( clr == 16 ) then
          red = 0 ; green = 0 ; blue = 200
         end
          if( clr == 17 ) then
          red = 200 ; green = 0 ; blue = 200
         end
          if( clr == 18 ) then
          red = 150 ; green = 0 ; blue = 0
         end
          if( clr == 19 ) then
          red = 0 ; green = 150 ; blue = 0
         end
          if( clr == 20 ) then
          red = 0 ; green = 0 ; blue = 150
         end
          if( clr == 21 ) then
          red = 100 ; green = 0 ; blue = 0
         end
          if( clr == 22 ) then
          red = 0 ; green = 100 ; blue = 0
         end
         if( clr == 23 ) then
          red = 0 ; green = 0 ; blue = 100  -- Jesus Is Comming
         end
         color (red, green, blue,255)     
   
 end

 function RotateLeft()
      Ang = Ang + Ang1
      if Ang > Pi2 then
       Ang = Ang - Pi2
   end
   
 end
 function MoveSteps ( distance )
        dx = cos(Ang) * distance
        dy = sin(Ang) * distance
        x2 = x + dx
        y2 = y - dy
        line( x,y,x2,y2)
        x = x2 ; y = y2
 end   
 function Fractal(size)
         local    cnt = 0
          Ang1 = Pi2/Type
          Count = Count + 1
          while cnt < 3
          do                
             MoveSteps ( size )
             RotateLeft()
             cnt = cnt + 1
               if size > 10 then
                  Fractal(size/2)
               end
              
          end
 end

  x = 400 ; y = 290 ; Ang = 0    
  Count2 = 0
  color (red, green, blue,0)
   while ( Count2 < 20)
     do        
      Fractal(250)
      Count2 = Count2 + 1 ;   Ang = Count * 9
      SetColor( Count2 ) 
      end
 time2 = timerticks() - time1
drawtext("Press any key to exit ..",10,0)
drawtext( time2,10,30 )
drawtext(" ms. Drawing time ",60,30)
sync()

key=inkey()
closewindow(win)             -- This ends the program.
closeapplication()









































 

Make a free website with Yola