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 - Challenge 127 // Program: SchoellerSimon.cpp // Autor: Simon Schoeller // 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(); // F ifm::right(89); ifm::forward(); ifm::left(91); } else { f(i-1); ifm::right(90); f(i-1); ifm::left(90); f(i-1); } } int main () { std::cout << "Number of iterations =? (11 recomended) "; unsigned int n; std::cin >> n; // draw w_n = w_n(F) f(n); return 0; }