summaryrefslogtreecommitdiff
path: root/examples/graftals/Dragon.gf
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2009-02-14 14:07:04 +0000
committerkrasimir <krasimir@chalmers.se>2009-02-14 14:07:04 +0000
commite6fd01066bb50626a10cdc93c344488077e5183f (patch)
tree35dca8f1d259c842a82957f83da131885c2fe171 /examples/graftals/Dragon.gf
parent3548610ba12a42d391c06cde41912ef61741b197 (diff)
Graftals in GF. examples/graftals
Diffstat (limited to 'examples/graftals/Dragon.gf')
-rw-r--r--examples/graftals/Dragon.gf13
1 files changed, 13 insertions, 0 deletions
diff --git a/examples/graftals/Dragon.gf b/examples/graftals/Dragon.gf
new file mode 100644
index 000000000..ff151ce95
--- /dev/null
+++ b/examples/graftals/Dragon.gf
@@ -0,0 +1,13 @@
+concrete Dragon of Graftal = {
+lincat N = {x : Str; y : Str} ;
+lincat S = {s : Str} ;
+
+lin z = {x = ""; y = ""} ;
+lin s x = {x = x.x ++ R ++ x.y ++ F ++ R; y = L ++ F ++ x.x ++ L ++ x.y} ;
+lin c x = {s = "newpath 300 550 moveto" ++ F ++ x.x ++ "stroke showpage"} ;
+
+oper F : Str = "0 5 rlineto" ;
+oper L : Str = "+90 rotate" ;
+oper R : Str = "-90 rotate" ;
+
+} \ No newline at end of file