Johdienemann Turtle1

Aus ProgrammingWiki

Wiki-Quelltext dieser Seite.

<language>Javascript</language>
'''Test Gebiet Turtle Quadrat ''' 
ZEICHENFELD = Canvas
Wir brauchen den Code für zeichen eins Quadrates
<canvas></canvas>
<code id="574fe80b6cabb">
function quadrat(x) {
        turtle.forward(x)  ;
        turtle.right(90)     ;
           turtle.forward(x)  ;
           turtle.right(90)     ;
            turtle.forward(x)  ;
            turtle.right(90)     ;
             turtle.forward(x)  ;
             turtle.right(90)     ;
}
</code>
<code id="574fe80b6cb37">
function rechteck(a,b) {
turtle.forward(b)  ;
        turtle.right(90)     ;
           turtle.forward(a)  ;
           turtle.right(90)     ;
            turtle.forward(b)  ;
            turtle.right(90)     ;
             turtle.forward(a)  ;
             turtle.right(90)     ;
}
</code>
<code id="574fe80b6cb9f">
function dreieckklassisch(c,a,b) {
turtle.forward(c)  ;
        turtle.right(120)     ;
           turtle.forward(a)  ;
           turtle.right(120)     ;
            turtle.forward(b)  ;
            turtle.right(120);     
}
</code>



<run id="574fe80b6cc09">
var c = new Canvas(1);
c.clear();
turtle.home()        ;
dreieck(50,40,30);
quadrat(60);
Rechteck(50;20);
</run>