Microsoft Small Basic
RSS

Navigation





Quick Search
»
Advanced Search »

PoweredBy

Drawing a Fibonacci Spiral using the Turtle

RSS
Modified on 2011/12/12 10:16 by 12.94.109.138 Categorized as Samples

Turtle.Speed = 10

fib[0] = 0.2
fib[1] = 0.2


arcAngle = 90

limit = 6

For i = 2 to limit
  fib[i] = fib[i-2] + fib[i-1]
EndFor


For i = 0 To limit
  arcLenght = (2 * fib[i] * Math.Pi)/10
  DrawArc()
  TextWindow.WriteLine("Fib(" + i + ") = " + fib[i])
EndFor


Sub DrawArc
  For h = 1 To arcAngle
    Turtle.Turn(1)
    Turtle.Move(arcLenght)
  EndFor
EndSub


ScrewTurn Wiki version 3.0.5.600. Some of the icons created by FamFamFam.