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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Informatik - Serie 10 - Aufgabe 123 // Program: DebusPascal1.cpp // Autor: P. Debus (Gruppe L) #include #include // POST: the word w_i^F is drawn void f (const unsigned int i) { if (i == 0) ifm::forward(); // F else { f(i-1); //F f(i-1); //F ifm::left(90); //+ f(i-1); //F ifm::left(90); //+ f(i-1); //F ifm::left(90); //+ f(i-1); //F ifm::left(90); //+ f(i-1); //F ifm::left(90); //+ f(i-1); //F ifm::right(90); //- f(i-1); //F } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; // s f(n); ifm::left(90); f(n); ifm::left(90); f(n); ifm::left(90); f(n); return 0; }