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 - Skript Aufgabe 127 // Programm:BikisChristos.cpp // Draw sth presumably amazing // Autor C.N.Bikis #include #include // necessary: x and y call each other void y (const unsigned int i); // POST: w_i^X is drawn void x (const unsigned int i) { if (i > 0) { x(i-1); // w_{i-1}^X ifm::left(90); // + ifm::left(60); ifm::forward(); ifm::forward(); y(i-1); // w_{i-1}^Y ifm::forward(); // F ifm::forward(); ifm::left(90); // + ifm::left(30); } } // POST: w_i^Y is drawn void y (const unsigned int i) { if (i > 0) { ifm::right(90); // - ifm::right(30); ifm::forward(); // F ifm::forward(); x(i-1); // w_{i-1}^X ifm::forward(); ifm::forward(); ifm::right(90); // - ifm::right(60); y(i-1); // w_{i-1}^Y } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; // draw w_n = w_n^X x(n); return 0; }