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 // Programm: BerchtoldAndreas.cpp // Autor: Andreas Berchtold (Gruppe C) #include #include #include void f (const int i) { if (i <= 0) { ifm::forward(); // F } else { int p = (rand()%25)+1; ifm::save(); ifm::left(p); ifm::forward(2*i); f(i-1); ifm::restore(); ifm::forward(); ifm::save(); ifm::right(p); ifm::forward(2*i); f(i-1); ifm::restore(); } } int main () { std::cout << "Number of iterations =? "; int n; std::cin >> n; // draw w_n = w_n(F) f(n); return 0; }