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 - Challenge 125 // Program: RothNina2.cpp // Author: Nina Roth //Draws a (sort of) circle #include #include // POST: the word w_i^F is drawn void g(); void f (const unsigned int i) { if (i == 0) ifm::forward(); else {f(i-1); ifm::right(108); f(i-1); ifm::left(144); f(i-1); ifm::right(108); f(i-1); ifm::left(144); f(i-1); ifm::right(108); f(i-1); ifm::left(144); f(i-1); ifm::right(108); f(i-1); ifm::left(144); f(i-1); ifm::right(108);f(i-1);ifm::left(144); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; // draw w_n = w_n(F) f(n); f(n); return 0; }