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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// fabian rohrbasser - Serie 11 - Challenge 125 // Prog: RohrbasserFabian.cpp // Author: Fabian Rohrbasser #include #include void x (const unsigned int i){ if(i>0){ ifm::forward(); ifm::right(180); x(i-1); ifm::left(60); //x(i-1); } } void y (const unsigned int i){ if(i>0){ ifm::forward(); ifm::right(180); y(i-1); ifm::right(60); //y(i-1); } } void f (const unsigned int i) { if(i==0){ ifm::forward(); } if (i > 0) { f(i-1); ifm::left(60); x(i-1); f(i-1); ifm::right(60); y(i-1); f(i-1); ifm::left(60); //f(i-1); } } // POST: w_i^F is drawn int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; // draw w_n = w_n^F f(n); return 0; }