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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Prog: LoukasCharisios.cpp // Draw turtle graphics for the Lindenmayer system with // C. G. Loukas #include #include void f (const unsigned int i) { if (i == 0) ifm::forward(); else { f(i-1); ifm::left(60); f(i-1); f(i-1); ifm::left(180); f(i-1); ifm::left(90); f(i-1); ifm::left(10); f(i-1); f(i-1); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; for(unsigned int j=0; j<365; ++j) { f(n); ifm::left(j); } return 0; }