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

Theory of Combinatorial Algorithms

Prof. Emo Welzl and Prof. Bernd Gärtner

#include #include using namespace std; using namespace ifm; void X(int n); void Y(int n); //Post: w_i^Y is drawn void Y(int n){ if (n==0)forward(); else{ X(n-1); left(90); Y(n-1); right(90); X(n-1); right(90); Y(n-1); left(90); X(n-1); } } //Post: w_i^x is drawn void X(int n){ if (n==0)forward(); else{ Y(n-1); right(90); X(n-1); left(90); Y(n-1); left(90); X(n-1); right(90); Y(n-1); } } int main(){ int n; cout<<"Welche Stufe?"<>n; //left(45); for (int i=0; i<4;++i){ Y(n); left(90); } }