' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '  
 '   F r a k t a l e s   F a r n b l a t t  
 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '  
  
 '   I n i t i a l i z e   a l p h a n u m e r i c   I / O   d i a l o g  
 I n i t D i a l o g  
 N a m e D i a l o g   " F a r n b l a t t "  
 S h o w D i a l o g  
  
 '   I n i t i a l i z e   g r a p h i c s   d i a l o g  
 I n i t G r a p h i c s   0 , 0 , 0  
 N a m e G r a p h i c s   " F a r n b l a t t "  
 D r a w T e x t   6 0 , 1 0 , " F a r n b l a t t " , 2 5 5 , 0 , 0  
  
 '   C a l l   c a l c u l a t i o n   s u b r o u t i n e  
 F a r n  
  
 '   C a l c u l a t i o n   s u b r o u t i n e  
 S u b   F a r n ( )  
       i   =   I n p u t ( " I t e r a t i o n s   [ 5 0 0 0 ] : " , " 5 0 0 0 " )  
       I f   i   =   " $ C L O S E "   T h e n  
             H i d e D i a l o g  
             E x i t   S u b  
       E n d   I f  
       '  
       I f   i   =   " "   T h e n  
             n m a x   =   1 0 0 0 0  
       E l s e  
             n m a x   =   C L n g ( i )  
       E n d   I f  
       '  
       x p i x   =   4 0 0  
       y p i x   =   2 0 0  
       '  
       a   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       b   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       c   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       d   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       e   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       f   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       p   =   A r r a y ( 0 , 0 , 0 , 0 , 0 )  
       '  
       p s u m   =   0  
       x f a c   =   x p i x   *   3 0   /   3 2 0  
       y f a c   =   y p i x   *   2 0   /   2 0 0  
       x 0   =   x p i x   /   2  
       y 0   =   y p i x  
       '  
       a ( 1 )   =   0  
       b ( 1 )   =   0  
       c ( 1 )   =   0  
       d ( 1 )   =   . 1 6  
       e ( 1 )   =   0  
       f ( 1 )   =   0  
       p p   =   . 0 1  
       p s u m   =   p s u m   +   p p  
       p ( 1 )   =   p s u m  
       '  
       a ( 2 )   =   . 2  
       b ( 2 )   =   - . 2 6  
       c ( 2 )   =   . 2 3  
       d ( 2 )   =   . 2 2  
       e ( 2 )   =   0  
       f ( 2 )   =   1 . 6  
       p p   =   . 0 7  
       p s u m   =   p s u m   +   p p  
       p ( 2 )   =   p s u m  
       '  
       a ( 3 )   =   - . 1 5  
       b ( 3 )   =   . 2 8  
       c ( 3 )   =   . 2 6  
       d ( 3 )   =   . 2 4  
       e ( 3 )   =   0  
       f ( 3 )   =   . 4 4  
       p p   =   . 0 7  
       p s u m   =   p s u m   +   p p  
       p ( 3 )   =   p s u m  
       '  
       a ( 4 )   =   . 8 5  
       b ( 4 )   =   . 0 4  
       c ( 4 )   =   - . 0 4  
       d ( 4 )   =   . 8 5  
       e ( 4 )   =   0  
       f ( 4 )   =   1 . 6  
       p p   =   . 8 5  
       p s u m   =   p s u m   +   p p  
       p ( 4 )   =   p s u m  
       '  
       x   =   0  
       y   =   0  
       '  
       S h o w G r a p h i c s  
       '  
       F o r   n   =   1   T o   n m a x  
             D r a w T e x t   6 0 , 1 0 , " F a r n b l a t t   " & C S t r ( n ) , 2 5 5 , 0 , 0  
             p p   =   R n d  
             F o r   j   =   1   T o   4  
                   I f   p p   < =   p ( j )   T h e n  
                         k   =   j  
                         E x i t   F o r  
                   E n d   I f  
                   I f   D o E v e n t s ( )   =   " $ S T O P "   T h e n  
                         S t a t u s   " S c r i p t   s t o p p e d . "  
                         E x i t   S u b  
                   E n d   I f  
             N e x t  
             x n e w   =   a ( k )   *   x   +   b ( k )   *   y   +   e ( k )  
             y n e w   =   c ( k )   *   x   +   d ( k )   *   y   +   f ( k )  
             x   =   x n e w  
             y   =   y n e w  
             I f   n   >   1 0   T h e n  
                   c o l   =   x 0   +   x   *   x f a c  
                   r o w   =   y 0   -   y   *   y f a c  
                   p x   =   c o l  
                   p y   =   r o w  
                   I f   n   M o d   2   =   0   T h e n  
                         D r a w P i x e l   p x - 8 0 , p y + 3 0 , 0 , 2 5 5 , 0  
                   E l s e  
                         I f   n   M o d   3   =   0   T h e n  
                               D r a w P i x e l   p x - 8 0 , p y + 3 0 , 0 , 2 5 5 , 0  
                         E l s e  
                               I f   n   M o d   5   =   0   T h e n  
                                     D r a w P i x e l   p x - 8 0 , p y + 3 0 , 0 , 2 5 5 , 0  
                               E l s e  
                                     I f   n   M o d   7   =   0   T h e n  
                                           D r a w P i x e l   p x - 8 0 , p y + 3 0 , 0 , 2 5 5 , 0  
                                     E l s e  
                                           D r a w P i x e l   p x - 8 0 , p y + 3 0 , 0 , 2 5 5 , 0  
                                     E n d   I f  
                               E n d   I f  
                         E n d   I f  
                   E n d   I f  
             E n d   I f  
             I f   D o E v e n t s ( )   =   " $ S T O P "   T h e n  
                   S t a t u s   " S c r i p t   s t o p p e d . "  
                   E x i t   S u b  
             E n d   I f  
       N e x t  
 E n d   S u b  
  
  
  
 