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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Program: FreiFlorian.cpp // Author: Florian Frei #include #include void f (const unsigned int i){ if (i==0) ifm::forward(); else { ifm::save; f(i-1); ifm::right(90); f(i-1); ifm::right(90); ifm::right(90); f(i-1); ifm::right(90); f(i-1); ifm::right(90); f(i-1); f(i-1); ifm::restore; ifm::left(90); } } int main () { std::cout << "Number of Iterations=?"; unsigned int n; std::cin >> n; f(n); return 0; }