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 - keine Aufgabe, einfach etwas.... Program: SchumacherSalome1.cpp Autor: Salome Schumacher Zweck: Zeichnet einen "Knopf" */ #include #include void f (const unsigned int i) { if (i == 0) ifm::forward(); // F else { f(i-1); ifm::right(90); f(i-1); f(i-1); ifm::right(180); f(i-1); ifm::right(90); f(i-1); f(i-1); ifm::right(180); f(i-1); ifm::right(90); f(i-1); f(i-1); ifm::right(180); f(i-1); ifm::right(90); f(i-1); f(i-1); ifm::right(90); f(i-1); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; f(n); ifm::right(72); return 0; }