home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d9xx / d969 / ace.lha / ACE / ACE-2.0.lha / PRGS.lha / Turtle / dragon.b < prev    next >
Text File  |  1994-01-10  |  680b  |  46 lines

  1. '..Dragon Curve 
  2. '..(recursive).
  3.  
  4. sub dragon(depth,side)
  5.  if depth = 0 then
  6.    Forward(side)
  7.  else
  8.    if depth > 0 then
  9.     dragon(depth-1,side)
  10.     turnRight(90)
  11.     dragon(-(depth-1),side)
  12.    else
  13.     dragon(-(depth+1),side)
  14.     turnRight(270)
  15.     dragon(depth+1,side)
  16.    end if
  17.  end if
  18. end sub
  19.  
  20. window 1,"Dragon Curve",(0,0)-(640,250)
  21. color 2,1
  22.  
  23. another$="Y"
  24. while another$="Y"
  25.  cls
  26.  locate 1,1
  27.  input "Enter depth (try 10): ",depth 
  28.  input "Enter sides (try 3):  ",sides 
  29.  
  30.  cls
  31.  
  32.  penup
  33.  setxy 320,125
  34.  pendown
  35.  dragon(depth,sides)
  36.  
  37.  locate 26,1
  38.  print "another (y/n)?"
  39.  another$=""
  40.  while another$<>"Y" and another$<>"N"
  41.    another$=ucase$(inkey$)
  42.  wend
  43. wend
  44.  
  45. window close 1
  46.