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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

#include #include void f(unsigned int x)// Die Funktion, die Fraktal zeichnet { if(x==0)//Das Wort, mit dem man anfaengt { ifm::forward(); ifm::left(45); ifm::forward(); ifm::right(90); ifm::forward(); ifm::left(135); } else { f(x-1); //W_n-1 ifm::left(45);//+ ifm::forward();//F //W_n-1 ifm::right(90);//+ ifm::forward();//F f(x-1); ifm::left(45); ifm::forward(); ifm::right(); } } int main() { std::cout<<"please input number of iterations "; unsigned int x; std::cin>>x; f(x); return 0; }