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 127 // Program: BulloniGopala3.cpp // Autor: Bulloni Gopala // 6 iteration #include #include void d (const unsigned int i); void f (const unsigned int i) { if (i == 0) ifm::forward(); else { f(i-1); ifm::left(10 * i); d(i-1); f(i-1); ifm::forward(3*i); ifm::left(47); f(i-1); f(i-1); ifm::right(92); f(i-1); d(i-1); } } void d (const unsigned int i){ if (i == 0 || i == 1) ifm::forward(); // F else { d(i-1); d(i-2); f(i-1); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; f(n); return 0; }