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 125 // Program: EstermannMiro.cpp // Autor: Miro Estermann #include #include // POST: the word w_i^F is drawn void f (const unsigned int i) { if (i == 0) ifm::forward(); // F else { f(i-1); f(i-1); ifm::left(25); f(i-1); ifm::save(); ifm::left(25); ifm::restore(); f(i-1); ifm::right(100); f(i-1); ifm::save(); ifm::right(100); f(i-1); ifm::restore(); ifm::right(100); ifm::save(); ifm::left(25); f(i-1); ifm::right(100); f(i-1); ifm::right(25); f(i-1); ifm::restore(); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; f(n); return 0; }