Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2016-06-02T08:01:44+00:00 → 2016-06-02T08:17:37+00:00
<language>Javascript</language> | |
| − | ''Diese Seite soll zeichnen'' |
| + | ''DIESE SEITE MALT EIN HAUS'' |
| − | |
<canvas></canvas> | |
| − | <code id="574fe7e783a9c"> |
| − | function gleichseitigesdreieck(x) { |
| + | <code id="574feba0e5c44"> |
| + | function quadrat(x) { |
| − | turtle.home(); |
| − | turtle.forward(40) |
| − | turtle.right(45); |
turtle.forward(x); | |
| − | turtle.right(120); |
| + | turtle.right(90); |
turtle.forward(x); | |
| − | turtle.right(120); |
| + | turtle.right(90); |
turtle.forward(x); | |
| − | turtle.right(120); |
| + | turtle.right(90); |
| − | } |
| + | turtle.forward(x); |
| + | turtle.right(90); |
| + | } |
</code> | |
| + | <code id="574feba0e5cb3"> |
| + | function dreieck(a) { |
| − | <code id="574fe7e783afc"> |
| − | function quadrat(a) { |
| − | |
| − | turtle.home(); |
| + | turtle.forward(50); |
| + | turtle.right(30); |
turtle.forward(a); | |
| − | turtle.right(90); |
| + | turtle.right(120); |
turtle.forward(a); | |
| − | turtle.right(90); |
| + | turtle.right(120); |
turtle.forward(a); | |
| − | turtle.right(90); |
| + | turtle.right(120); |
| − | turtle.forward(a); |
| − | turtle.right(90); |
| − | |
} | |
| − | |
</code> | |
| − | <run id="574fe7e783b5b"> |
| + | <run id="574feba0e5d31"> |
canvas.clear(); | |
turtle.home(); | |
| − | quadrat(40); |
| − | gleichseitigesdreieck(40); |
| + | quadrat(50); |
| + | dreieck(50); |
</run> |