// Informatik - Serie 11 - Challenge Aufgabe
// Programm: DautajVigan.cpp
// Vigan Dautaj
#include
#include
//POST: the word w_i^F is drawn
void x (const unsigned int i );
void y (const unsigned int i ) {
if (i > 0) {
y(i-1);
ifm::forward( );
y(i-1);
ifm::right(30);
ifm::forward( );
ifm::left(120);
x(i-1);
}
}
void x (const unsigned int i) {
if (i>0) {
ifm::left(30);
ifm::forward( );
ifm::right(120);
x(i-1);
y(i-1);
}
}
int main()
{
std::cout << "Number of iterations =? ";
unsigned int n;
std::cin >> n;
//draw w_n = w_n^X
y(n);
return 0;
}