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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

// Author: Luka Calic // Program: CalicLuka.cpp #include #include // Draw stars void f (const unsigned int i) { if (i ==0) ; else { f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); f(i-1); ifm::left(135); ifm::forward(50); ifm::right(120); } } int main(){ std::cout <<"The best number of iterations is 6 - Please type in the number of iterations=?"; unsigned int n; std::cin >> n; //Draw ifm::left(120); f(n); ifm::left(45); f(n); ifm::left(45); f(n); ifm::left(45); f(n); ifm::left(45); f(n); ifm::left(45); f(n); ifm::left(45); f(n); ifm::left(45); f(n); ifm::left(45); }