Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void paint(Graphics g) {
- super.paint(g);
- kroete = new Turtle(this);
- kroete.homePosition();
- kroete.dreheLinks(90);
- zeicheBaum(5,100);
- }
- public void zeicheBaum(int ordnung, double laenge) {
- int winkel = 45;
- kroete.bewege(laenge);
- if (ordnung > 0) {
- kroete.dreheLinks(winkel);
- zeicheBaum(ordnung -1, laenge*0.8);
- kroete.dreheRechts(winkel*2);
- zeicheBaum(ordnung -1, laenge*0.8);
- kroete.dreheLinks(winkel);
- }
- kroete.back((int)laenge);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement