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: SchmitzJeff.cpp // Author: Jeff Schmitz //This generates you some funny stick figures, dancing around. //Best seen with number of iterations=11,12 #include #include void y (const unsigned int i); void x (const unsigned int i) { if (i > 0) { ifm::forward(1); ifm::save(); ifm::left(60); ifm::forward(10); ifm::right(90) ; ifm::forward(10); ifm::restore(); x(i-1); y(i-1); } } void y (const unsigned int i) { if (i > 0) { ifm::right(75); x(i-1); y(i-1); ifm::forward(20); ifm::left(90); ifm::forward(); } } int main () { std::cout << "Number of iterations =? "; unsigned int n; std::cin>>n; x(n); return 0; }