Turtlegraphics for Smartphones and Tablets

Bern University of Teacher Education  
HomeStart Online EditorPrintAndroid GamesJava-Online

Serie 7: Recursions


1)

The drawing on the right is created by the adjustment of the example Tu12.java.

Exercise 2 can be solved with the aid of the example Baum.java.

2)
 
3)


For the drawing of the flake, the following code is used:

void figur(double s) 
{
for (int i = 0; i < 6; i++)
{
fd(s);
figur(s / 3);
bk(s);
rt(60);
}
}
You may take the program structure from the recursion tree:

Edit source with online-compiler


4)

Install with the aid of QR-Code some recursions from the website.
Known recursions on your tablet or smartphone.