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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Informatik - Fractal // Autor: Roberto Skory // Program: SkoryRoberto.cpp // Draws a fractal // Best picture is with 15 iterations #include #include void y (const unsigned int); void x (const unsigned int i){ if (i > 0){ ifm::right(72); x(i-1); ifm::forward(); y(i-1); ifm::forward(); x(i-1); ifm::right(72); } else ifm::forward(); } void y (const unsigned int i){ if (i > 0){ ifm::right(36); y(i-1); ifm::left(36); } else ifm::forward(); } int main (){ std::cout << "Number of iterations = "; unsigned int n; std::cin >> n; x(n); return 0; }