mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
Graftals in GF. examples/graftals
This commit is contained in:
12
examples/graftals/Koch.gf
Normal file
12
examples/graftals/Koch.gf
Normal file
@@ -0,0 +1,12 @@
|
||||
concrete Koch of Graftal = {
|
||||
lincat N = {f : Str} ;
|
||||
lincat S = {s : Str} ;
|
||||
|
||||
lin z = {f = F} ;
|
||||
lin s x = {f = x.f ++ L ++ x.f ++ R ++ x.f ++ R ++ x.f ++ L ++ x.f} ;
|
||||
lin c x = {s = "newpath 10 550 moveto" ++ x.f ++ "stroke showpage"} ;
|
||||
|
||||
oper F : Str = "2 0 rlineto" ;
|
||||
oper L : Str = "+90 rotate" ;
|
||||
oper R : Str = "-90 rotate" ;
|
||||
}
|
||||
Reference in New Issue
Block a user