// Prog: Lindenmayersystem.cpp
// Lindemayer system von Philipp Baumann
// Best Pics at 4 Iterations
#include
#include
#include
void F (const unsigned int i) {
if (i == 0)
ifm::forward(); // F
else {
F(i-1); // w_{i-1}^F
F(i-1); // w_{i-1}^F
ifm::right((rand() %15 + 10)); // -
ifm::save();
ifm::right((rand() %15 + 10)); // -
F(i-1); // w_{i-1}^F
ifm::left((rand() %15 + 9)); // +
F(i-1); // w_{i-1}^F
ifm::left((rand() %15 + 9)); // +
F(i-1); // w_{i-1}^F
ifm::restore();
ifm::left((rand() %15 + 9)); // +
ifm::save();
ifm::left((rand() %15 + 9)); // +
F(i-1); // w_{i-1}^F
ifm::right((rand() %15 + 10)); // -
F(i-1); // w_{i-1}^F
ifm::right((rand() %15 + 10)); // -
F(i-1); // w_{i-1}^F
ifm::right((rand() %12 + 10)); // -
F(i-1); // w_{i-1}^F
ifm::restore();
}
}
int main () {
std::cout << "Number of iterations =? ";
unsigned int n;
std::cin >> n;
//
ifm::left((rand() %10 + 80)); // +
F(n); // w_{i-1}^F
return 0;
}