Symbols

  • F : Move the turtle forward
  • - : Rotate the turtle CW
  • + : Rotate the turtle CCW
  • [ : Save the current turtle state and push it to the top of stack
  • ] : Apply the last saved state by popping from the stack
  • C0 : Change the drawing color to the 1st element in colors array
  • C1 : Change the drawing color to the 2nd element in colors array
  • C2 : Change the drawing color to the 3rd element in colors array
  • C3 : Change the drawing color to the 4th element in colors array
  • C4 : Change the drawing color to the 5th element in colors array
  • C5 : Change the drawing color to the 6th element in colors array
  • C6 : Change the drawing color to the 7th element in colors array
  • C7 : Change the drawing color to the 8th element in colors array
  • C8 : Change the drawing color to the 9th element in colors array
  • C9 : Change the drawing color to the 10th element in colors array

Details

Trees

  • Axiom Used: F
  • Rule Used: F=C0F[C1+F][F[C2+F][F][C2-F]][C1-F]
  • Final iterations: 6

Sun

  • Axiom Used: [X]++[X]++[X]++[X]++[X]
  • Rule 1: W=YF++ZF----XF[-YF----WF]++
  • Rule 2: X=C0+YF--ZF[C1---WF--XF]+
  • Rule 3: Y=-WF++XF[+++YF++ZF]-
  • Rule 4: Z=--YF++++WF[+ZF++++XF]--XF
  • Rule 5: F=
  • Final iterations: 5

Test Cases

Tested on MacBook Pro (Late 2016 - A1706)

  • Tree Iterations : 1
  • Sun Iterations : 1
  • Runtime : 175 ms
  • Tree Iterations : 2
  • Sun Iterations : 2
  • Runtime : 185 ms
  • Tree Iterations : 3
  • Sun Iterations : 3
  • Runtime : 193 ms
  • Tree Iterations : 4
  • Sun Iterations : 4
  • Runtime : 207 ms
  • Tree Iterations : 5
  • Sun Iterations : 5
  • Runtime : 302 ms
  • Tree Iterations : 6
  • Sun Iterations : 6
  • Runtime : 2.35 sec
  • Tree Iterations : 6
  • Sun Iterations : 5
  • Runtime : 2.05 sec
  • Tree Iterations : 6
  • Sun Iterations : 7
  • Runtime : 7.33 sec
  • Tree Iterations : 7
  • Sun Iterations : 7
  • Runtime : 6.06 mins


Credits