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: GopalaBulloni1.cpp // Autor: Bulloni Gopala // 7 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(60); d(i-1); ifm::left(50); f(i-1); ifm::left(66); d(i-1); ifm::right(71); f(i-1); } } void d (const unsigned int i){ if (i == 0) ifm::forward(); else { d(i-1); ifm::right(10); f(i-1); ifm::right(15); d(i-1); } } int main () { std::cout << "Number of iterations = ? "; unsigned int n; std::cin >> n; ifm::save(); // for do the same draw turned to the center 3 times ifm::jump(20); f(n); ifm::restore(); ifm::left(120); ifm::save(); ifm::jump(20); f(n); ifm::restore(); ifm::left(120); ifm::jump(20); f(n); return 0; }