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 Aufg. 127 // Program: RohrbasserFabian.cpp // Autor: F. Rohrbasser (Gruppe G) // Spuckt bei n grsser 6, sechs Kofferfische aus #include #include void f (const unsigned int i) { if (i == 0) ifm::forward(); //F else{ f(i-1); ifm::right(70); ifm::forward(7);// 1 Teil Grund ifm::save(); ifm::left(290); ifm::forward(8); //Leine ifm::save(); ifm::left(90); ifm::forward(7); //Unterkiefer ifm::save(); ifm::right(90); ifm::forward(1); ifm::save(); ifm::right(90); ifm::forward(2); ifm::save(); ifm::right(180); ifm::forward(2); ifm::save(); ifm::right(90); ifm::forward(1); ifm::save(); ifm::right(90); ifm::forward(3); ifm::save(); ifm::right(90); ifm::forward(2); // Ende Maul ifm::save(); ifm::right(180); ifm::forward(6); ifm::save(); ifm::right(90); ifm::forward(3); ifm::save(); ifm::right(90); ifm::forward(3); ifm::save(); ifm::right(90); ifm::forward(3); //Ende Auge ifm::save(); ifm::right(90); ifm::forward(5); ifm::save(); ifm::right(90); ifm::forward(8); ifm::save(); ifm::left(60); ifm::forward(2); ifm::save(); ifm::left(120); ifm::forward(3); ifm::save(); ifm::left(60); ifm::forward(2); // Ende Rckenflosse ifm::save(); ifm::left(120); ifm::forward(8); ifm::save(); ifm::right(90); ifm::forward(4); ifm::save(); ifm::left(60); ifm::forward(4); ifm::save(); ifm::left(120); ifm::forward(4); ifm::save(); ifm::left(120); ifm::forward(4); // Ende Schwanzflosse ifm::save(); ifm::left(60); ifm::forward(4); ifm::save(); ifm::right(90); ifm::forward(9); ifm::save(); //Ende Fisch ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::restore(); ifm::left(10); // 2 Teil Grund ifm::forward(30); } } int main() { std::cout<< "Number of iterations =? "; unsigned int n; std::cin>> n; f(n); return 0; }