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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Author: Timo Welti // Prog: WeltiTimo4.cpp #include #include void f (const unsigned int i) { if (i == 0) ifm::forward(); else { f(i-1); ifm::left(108); f(i-1); ifm::right(72); f(i-1); ifm::right(72); f(i-1); ifm::right(72); f(i-1); ifm::left(108); f(i-1); } } int main () { std::cout << "Number of iterations (smaller than 9, otherwise computation will take rahter long)=? "; unsigned int n; std::cin >> n; f(n); ifm::left(72); f(n); ifm::left(72); f(n); ifm::left(72); f(n); ifm::left(72); f(n); return 0; }