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 // Prog: SturmPaul.cpp // Draw the a Population of i Snoopydoggydogs by using Turtle // production F -> F+F+ and initial word F. // Autor: Paul Sturm // Für dizzles 10,11 braucht er recht lange, aber lohnt sich!! #include #include // POST: the word w_i^F is drawn void f (const unsigned int i) { if (i == 0) ifm::forward(); // F else { f(i-1); // w_{i-1}^F ifm::left(10); // + f(i-1); // w_{i-1}^F ifm::left(160); f(i-1); ifm::right(50); f(i-1); ifm::right(140); // + } } int main () { std::cout << "Enter Number of Snoopydoggydogs (dizzles) to get some Shizzle done." << "\n(Best dizzles from 9 to 11!)"<< "\n dizzles="; unsigned int n; std::cin >> n; // draw w_n = w_n(F) f(n); return 0; }