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 - Skriptaufgabe 125 // Author: Jan Stutz // Prog: StutzJan.cpp // Draw turtle graphics for the Lindenmayer system. #include #include // POST: the word w_i^F is drawn void f (const unsigned int i) { if (i == 0) ifm::forward(); else { f(i-1); ifm::right(30); f(i-1); ifm::right(30); f(i-1); ifm::forward(); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; // draw f(n); return 0; }