Versionsvergleich

Aus ProgrammingWiki

Vergleich: 2014-05-09T09:42:16+00:00 → 2014-05-23T10:18:24+00:00

<language>Java</language>
−
=== Nikolaushaus ===
−
−
<code id="536373fc10253">
−
``public void nikolaushaus(object turtle, double x){
−
−
}
−
</code>
−
−
<canvas width="300" height="400"></canvas>
−
−
<run id="536373fc102e7">
−
canvas1.clear();
−
turtle1.move(150,200);
−
nikolaushaus(50);
−
public void nikolaushaus(Object turtle, double x) {
−
double c = Math.sqrt(2) * x;
−
turtle.forward(x);
−
turtle.right(45);
−
turtle.forward(c/2);
−
turtle.right(90);
−
turtle.forward(c/2);
−
turtle.right(135);
−
turtle.forward(x);
−
turtle.left(135);
−
turtle.forward(c);
−
turtle.left(135);
−
turtle.forward(x);
−
turtle.left(135);
−
turtle.forward(c);
−
turtle.left(135);
−
turtle.forward(x);
−
−
−
−
−
−
}
−
</run>