From tftn@earthlink.net Mon Jul 20 15:49:18 1998
From: ROGER BAGULA <tftn@earthlink.net>
Newsgroups: sci.fractals
Subject: the program
Date: Thu, 09 Jul 1998 12:37:52 -0800
Organization: EarthLink Network, Inc.
Lines: 112
Message-ID: <35A52A19.6A73@earthlink.net>
Reply-To: tftn@earthlink.net
NNTP-Posting-Host: pool035-max14.ds6-ca-us.dialup.earthlink.net
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="------------14DC42BB6F1B"
X-Mailer: Mozilla 3.04Gold (Macintosh; I; PPC)
Path: news.uni-ulm.de!news.belwue.de!news.uni-stuttgart.de!uni-erlangen.de!newsfeed.nacamar.de!oleane!nntprelay.mathworks.com!newsfeed1.earthlink.net!nntp.earthlink.net!not-for-mail
Xref: news.uni-ulm.de sci.fractals:8270

This is a multi-part message in MIME format.

--------------14DC42BB6F1B
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

the program:
I have an example graphic that I will send email. 
Respectfully,
Roger L. Bagula
tftn@earthlink.net
11759Waterhill Road 
Lakeside,Ca 92040-2905
tel: 619-5610814
URL: http://home.earthlink.net/~tftn

--------------14DC42BB6F1B
Content-Type: text/plain; charset=iso-8859-1; x-mac-type="54455854"; x-mac-creator="54525545"; name="GENVONKOCH_TURTLE.TRU"
Content-Transfer-Encoding: 8bit
Content-Description: True BASIC Editor (PPC) Document
Content-Disposition: inline; filename="GENVONKOCH_TURTLE.TRU"

!general von Koch fractal 
!TRUE BASIC BY R.L.BAGULA
Set Mode "color"
set color mix (1) 0,0,0
print"general von Koch fractal "
print "TRUE BASIC BY R.L.BAGULA 9 JULY 1998©"
print "input von koch type  try 4 for fast"
input m
print "input complexity level try 4 for fast"
input level
print "similarity dimension:s=log(";m+1;")/log(3)=";log(m+1)/log(3)
set color 0
let depth=level
let size=6*60*2*1.2/3
CALL FORWARD (100)
CALL LEFT(90)
CALL BACK( 200)
let parity =1
set color 1
call genvonkoch(depth,size,parity,m)
end
external
sub genvonkoch(depth,size,parity,m)
 do while depth>-1
let factor =3
let angle=360/m
let notangle=180-angle
if depth=0 then  call forward(size)
if depth=0 then  exit do
call genvonkoch(depth-1,size/factor,parity,m)
call left(parity*notangle)
for n=1 to m-2
call genvonkoch(depth-1,size/factor,parity,m)
call right(parity*angle)
next n
call genvonkoch(depth-1,size/factor,parity,m)
call left(parity*notangle)
let depth=depth-1
let size =size/factor
let parity =parity
loop
end sub
!  Turtle graphics -- a sample module.!  Version 1.0
MODULE Turtle
    SHARE x, y, a                 !current turtle position, direction
    OPTION ANGLE degrees          !use degrees throughout module
   CALL ClearScreen              !initialize -- clear screen
    !   ClearScreen    !
   !  Clear the output window, set the x/y position to
    !  (0,0) and turn the turtle to face "up".   !
  SUB ClearScreen
       CLEAR
        SET WINDOW -785/2, 785/2, -565/2, 565/2
        LET x,y = 0
        LET a = 90
    END SUB
    !   !  Left   !
   !  Turn left by 'da' degrees.  Don't move; just turn.    !
   SUB Left(da)
        LET a = a + da
    END SUB
    !   !  Right    !
    !  Turn right by 'da' degrees.  Don't move; just turn.   !
   SUB Right(da)
        LET a = a - da
   END SUB
  !   !  Forward   !
   !  Go forward 'd' units.  We move in the current direction    !
   SUB Forward(d)
        LET dx = d*cos(a)         !compute x/y distances to move
        LET dy = d*sin(a)
       LET newx = x + dx         !get new x/y position
       LET newy = y + dy
      PLOT x,y; newx, newy      !draw line from old position to new
       LET x = newx
       LET y = newy              !remember new position
    END SUB
    !    !  Back
   !
 !  Go backward 'd' units.  We move in the opposite
   !  of the current direction.
    !
   SUB Back(d)       
CALL Forward(-d)   
 END SUB
END MODULE


--------------14DC42BB6F1B--


