## Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Informatik - Serie 11 - Aufgabe 127 // Programm: MerkleJonas1.cpp // Autor: Jonas Merkle (Gruppe O) // Kreise... #include #include void a (unsigned j) { if (j==0) { for(unsigned int j=0;j<90;++j) { ifm::right(1); ifm::forward(); }} else { ifm::save(); ifm::right(10); a(j-1); ifm::right(10); a(j-1); ifm::restore(); } } void b (unsigned j) { if (j==0) { for(unsigned int j=0;j<20;++j) { ifm::right(j); ifm::forward(15); }} else { ifm::save(); ifm::right(5); b(j-1); ifm::right(5); b(j-1); ifm::restore(); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin >> n; ifm::forward(222); ifm::right(60); for(unsigned int z=0;z<6;++z){ for(unsigned int i=0; i<8;++i){ a(n); ifm::right(45); } ifm::right(60); ifm::forward(222); } ifm::left(240); ifm::forward(444); ifm::left(120); ifm::forward(222); ifm::left(120); ifm::forward(444); ifm::left(120); ifm::forward(222); ifm::left(120); ifm::forward(444); ifm::left(180); ifm::forward(222); for(unsigned int i=0; i<8;++i){ b(n); ifm::right(45); } return 0; }