// Informatik - Serie 11 - Challenge 125
// Program: KonradLukas.cpp
// Author: Lukas Konrad
// guvaan.cpp ("Guantánamo visto do alto à noite")
// Shows you secret details that have never been revealed before.
// Please treat this information with strictest confidentiality and be sure that you are not observed when running the program!
#include
#include
// PRE: A good value for the number of iterations would be 10.
// POST: The secret bird-view of Guantánamo at night is being computed.
void f (const unsigned int i) {
if (i == 0)
ifm::forward();
else {
f(i-1);
ifm::forward(9);
ifm::left(45);
ifm::forward(1);
ifm::left(45);
ifm::save();
ifm::forward(3);
ifm::right(195);
ifm::forward(2);
f(i-1);
ifm::restore();
ifm::right(195);
ifm::forward(2);
ifm::right(20);
ifm::save();
ifm::left(50);
ifm::forward(5);
f(i-1);
ifm::restore();
ifm::save();
ifm::right(60);
ifm::forward(3);
}
}
int main () {
std::cout << "Number of iterations =? (10 would be a great choice!)";
unsigned int n;
std::cin >> n;
// draw the picture
ifm::left(75);
ifm::forward(11);
f(n);
return 0;
}