// Author: Raphael Schumacher
// Prog: SchumacherRaphael2.cpp
#include
#include
// POST: the word w_i^F is drawn
void f (const unsigned int i) {
if (i == 0)
ifm::forward(); // F
else {
f(i-1); // w_{i-1}^F
ifm::left(90); // +
f(i-1);
ifm::right(90);
f(i-1);
ifm::right(90);
}
}
int main () {
std::cout << "Number of iterations =? ";
unsigned int n;
std::cin >> n;
// draw w_n = w_n(F)
f(n);
return 0;
}