// Informatik - Serie 10 - Aufgabe 123
// Program: DebusPascal2.cpp
// Autor: P. Debus (Gruppe L)
#include
#include
void y (const unsigned int i);
// POST: w_i^X is drawn
void x (const unsigned int i) {
if(i==0)
ifm::forward(); // X
else {
y(i-1); // Y
ifm::left(60); // +
x(i-1); // X
ifm::left(60); // +
y(i-1); // Y
}
}
// POST: w_i^Y is drawn
void y (const unsigned int i) {
if(i==0)
ifm::forward(); // Y
else {
x(i-1); // X
ifm::right(60); // -
y(i-1); // Y
ifm::right(60); // -
x(i-1); // X
}
}
int main () {
std::cout << "Number of iterations =? ";
unsigned int n;
std::cin >> n;
// s
y(n);
return 0;
}