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 104 //Programm: MischaKnabenhans1.C //Autor: Mischa Knabenhans (Gruppe D) #include #include void y (unsigned int i); //POST: the word w_i^F is drawn void x (unsigned int i){ if (i == 0){ ifm::forward (); } else{ y (i-1); ifm::right (120); x(i-1); ifm::left (90); y(i-1); ifm::right (120); } } //POST: the word w_i^F is drawn void y (unsigned int i){ if (i == 0){ ifm::forward (); } else{ x(i-1); ifm::right (120); y(i-1); ifm::left (90); x(i-1); ifm::right (120); } } int main () { std::cout << "Number of iterations = ?\n"; unsigned int n; std::cin >> n; x(n); return 0; }