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 // Prog: StaehliAngela.cpp // Autor: Angela Staehli #include #include // POST: the word w_i^F is drawn void f (unsigned int i) { if (i == 0) ifm::forward(); // F else { f(i-1); ifm::left(22); ifm::right(22); ifm::save(); ifm::right(22); f(i-1); ifm::left(22); ifm::restore(); ifm::save(); ifm::left(22); f(i-1); ifm::right(22); ifm::restore(); f(i-1); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; // draw w_n = w_n(F), vertically ifm::left(90); f(n); return 0; }