Department of Computer Science | Institute of Theoretical Computer Science | CADMO

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

//Informatik Serie 11 //program: KellerTobias2.cpp //Author: Tobias Keller //This program draws a Lindenmayer system with Turtle #include #include using namespace ifm; void g (unsigned int n); void f (unsigned int n) { if (n == 0) forward (); else { f(n-1); left (60); f(n-1); right (60); } } void g (unsigned int n) { if (n == 0) forward (); else { f(n-1); right (60); g(n-1); left (60); f(n-1); } } int main () { unsigned int n; std::cout<< "Number of iterations?.\n"; std::cin >> n ; //function call f(n); return 0; }