Add Dragon curve

This commit is contained in:
Dimitri Lozeve 2018-01-16 23:36:41 +00:00
parent e720d90160
commit 103645595d

View file

@ -7,6 +7,7 @@ module Examples
, kochSnowflake , kochSnowflake
, sierpinski , sierpinski
, sierpinskiArrow , sierpinskiArrow
, dragon
) where ) where
import Lib import Lib
@ -69,3 +70,13 @@ sierpinskiArrow = LSystem
60 60
10 10
[('A',Forward), ('B',Forward), ('+',TurnRight), ('-',TurnLeft)] [('A',Forward), ('B',Forward), ('+',TurnRight), ('-',TurnLeft)]
-- | Dragon curve
dragon = LSystem
"FX+-"
"FX"
[('X', "X+YF+"),
('Y', "-FX-Y")]
90
10
[('F',Forward), ('+',TurnRight), ('-',TurnLeft)]