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: GerbatschTillmann.cpp // author: Tillmann Gerbatsch // no iterations: 10,11,12 #include #include void f (const unsigned int i) { if (i <= 2) { ifm::forward(i); // F } else { //ifm::forward(); f(i-1); ifm::left(45); ifm::forward(); ifm::save(); ifm::right(45); ifm::forward(); f(i-1); ifm::restore(); f(i-1); ifm::forward(); ifm::right(45); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; //function call f(n); return 0; }