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 - Skriptaufgabe 125 // Prog: VonBaussernSamuel.cpp // Author: Samuel E. v. Baussnern #include #include // POST: the word w_i^F is drawn void f (const unsigned int i){ if (i==0) ifm::forward(); else{ f(i-1); ifm::save(); ifm::left(30); f(i-1); ifm::left(30); ifm::forward(); f(i-1); ifm::restore(); ifm::save(); ifm::right(30); f(i-1); ifm::right(30); ifm::forward(); f(i-1); ifm::restore(); f(i-1); }} int main(){ std::cout << "Number of iterations =?" << " 5 are recommended..."; unsigned int n; std::cin >> n; f(n); return 0; }