From 76a579c98148d225b9c9cb9362797bb9ab83b90f Mon Sep 17 00:00:00 2001 From: Dimitri Lozeve Date: Wed, 17 Jan 2018 11:09:11 +0000 Subject: [PATCH] Add Penrose P3 tiling --- app/Main.hs | 2 +- src/Examples.hs | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/app/Main.hs b/app/Main.hs index d845858..fcbe4e0 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -8,4 +8,4 @@ import Examples main :: IO () main = display (InWindow "L-System" (200, 200) (10, 10)) black (color white pic) - where pic = drawLSystem $ iterateLSystem 7 plant + where pic = drawLSystem $ iterateLSystem 6 penroseP3 diff --git a/src/Examples.hs b/src/Examples.hs index 80a4206..0b7c3ea 100644 --- a/src/Examples.hs +++ b/src/Examples.hs @@ -11,6 +11,8 @@ module Examples , dragon , tree , plant + -- * Tilings + , penroseP3 ) where import Lib @@ -112,3 +114,18 @@ plant = LSystem 25 1 [('F',Forward), ('+',TurnRight), ('-',TurnLeft), ('[',Push), (']',Pop)] + +-- | Penrose P3 +penroseP3 = + LSystem + "MNOPA+-[]" + "[N]++[N]++[N]++[N]++[N]" + [('M',"OA++PA----NA[-OA----MA]++") + ,('N',"+OA--PA[---MA--NA]+") + ,('O',"-MA++NA[+++OA++PA]-") + ,('P',"--OA++++MA[+PA++++NA]--NA") + ,('A',"")] + 36 + 10 + [('M',Forward), ('N',Forward), ('O',Forward), ('P',Forward), ('A',Forward), + ('+',TurnRight), ('-',TurnLeft), ('[',Push), (']',Pop)]