
The Fibonacci word may be represented as a fractal as described here:


(Clicking on the above website   (hal.archives-ouvertes.fr)    will leave a cookie.)



For F_wordm start with F_wordCharn=1
Draw a segment forward
If current F_wordChar is 0
Turn left if n is even
Turn right if n is odd
next n and iterate until end of F_word


Task

Create and display a fractal similar to Fig 1.


(Clicking on the above website   (hal.archives-ouvertes.fr)    will leave a cookie.)

(*note, this usage of Module allows us to memoize FibonacciWord
  without exposing it to the global scope*)
Module[{FibonacciWord, step},
  FibonacciWord[1] = "1";
  FibonacciWord[2] = "0";
  FibonacciWord[n_Integer?(# > 2 &)] :=
   (FibonacciWord[n] = FibonacciWord[n - 1] <> FibonacciWord[n - 2]);
 
  step["0", {_?EvenQ}] = N@RotationTransform[Pi/2];
  step["0", {_?OddQ}] = N@RotationTransform[-Pi/2];
  step[___] = Identity;
 
  FibonacciFractal[n_] := Module[{steps, dirs},
    steps = MapIndexed[step, Characters[FibonacciWord[n]]];
    dirs = ComposeList[steps, {0, 1}];
    Graphics[Line[FoldList[Plus, {0, 0}, dirs]]]]];