//Informatik - Serie 11 - Aufgabe 104
//Programm: MischaKnabenhans2.C
//Autor: Mischa Knabenhans (Gruppe D)
#include
#include
void y (unsigned int i);
//POST: the word w_i^F is drawn
void x (unsigned int i){
if (i == 0){
ifm::forward ();
}
else{
x (i-1);
ifm::left (120);
y (i-1);
ifm::left (120);
ifm::left (120);
y (i-1);
ifm::right (120);
x (i-1);
ifm::right (120);
ifm::right (120);
x (i-1);
ifm::right (120);
y (i-1);
ifm::left (120);
}
}
//POST: the word w_i^F is drawn
void y (unsigned int i){
if (i == 0){
ifm::forward ();
}
else{
ifm::right (60);
x (i-1);
ifm::left (60);
(y (i-1));
ifm::left (60);
ifm::left (60);
y (i-1);
ifm::right (60);
x (i-1);
ifm::right (60);
ifm::right (60);
x (i-1);
ifm::right (60);
y (i-1);
}
}
int main ()
{
std::cout << "Number of iterations = ?\n";
unsigned int n;
std::cin >> n;
x(n);
return 0;
}