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 - Aufgabe 125 //Programm: BodoRueckauer.cpp //Autor: Bodo Rueckauer // I'm not exactly sure what this drawing is representing, but it gets interesting for values over 200. #include #include void x(const unsigned int n) { if (n > 8){ ifm::forward(n); ifm::right(10*n); x (n-1);} } void y (const unsigned int n) { if (n > 5){ ifm::forward(2*n); ifm::right(20*n); y (n-1);} } void z (const unsigned int n) { if (n > 0){ ifm::forward(3*n); ifm::right(30*n); z (n-1);} } void w(const unsigned int n) { if (n == 0) ifm::forward(); else { ifm::save(); ifm::forward(); x(n-1); ifm::restore(); ifm::save(); y(n-1); ifm::restore(); ifm::save(); z(n-1); ifm::restore(); } } int main() { unsigned int n; std::cout<< "number of iterations = ? "; std::cin>> n; w(n); return 0; }