Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2016-06-02T07:57:10+00:00 → 2016-06-09T08:36:12+00:00
<language>Javascript</language> | |
'''Test Gebiet Turtle Quadrat ''' | |
ZEICHENFELD = Canvas | |
Wir brauchen den Code für zeichen eins Quadrates | |
| − | <canvas></canvas> |
| − | <code id="574fe2d96cbee"> |
| − | 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="574fe6d5d9a9a"> |
| − | 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="574fe6d5d9b0e"> |
| − | function dreieck(c) { |
| − | turtle.forward(c) ; |
| + | <canvas width=800 height=800></canvas> |
| + | |
| + | <code id="57592a7c38d60"> |
| + | 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) ;} |
| + | |
| + | function rechteck(a,b) { turtle.forward(b) ; turtle.right(90) ; turtle.forward(a) ; turtle.right(90) ; turtle.forward(a) ; turtle.right(90) ; turtle.forward(a) ; turtle.right(90) ;} |
| + | function dreieck(a) { |
| + | turtle.forward(a) ; |
turtle.right(120) ; | |
| − | turtle.forward(c) ; |
| + | turtle.forward(a) ; |
turtle.right(120) ; | |
| − | turtle.forward(c) ; |
| − | turtle.right(120) |
| + | turtle.forward(a) ; |
| + | turtle.right(120); |
} | |
| − | </code> |
| + | function haus(a) { |
| + | quadrat(a); |
| + | turtle.forward(a); |
| + | turtle.right(90) ; |
| + | turtle.forward(a) ; |
| + | turtle.right(180); |
| + | dreieck(a); |
| + | |
| + | } |
| − | |
| − | |
| − | <run id="574fe6d5d9b7a"> |
| + | function auto_q (a) { |
| + | for(i = 1; i < 5; i++ ) |
| + | { turtle.forward(a); turtle.right(90); } |
| + | } |
| + | function drehqzwanzig (a) { |
| + | for(j = 1; j < 40; j++ ) |
| + | {auto_q (a) ; turtle.right (10) ; } |
| + | } |
| + | </code> |
| + | <run id="57592a7c38dcb"> |
var c = new Canvas(1); | |
c.clear(); | |
| − | turtle.home() ; |
| − | dreieck(50); |
| − | quadrat(60); |
| − | Rechteck(50;20); |
| + | turtle.home() ; |
| + | turtle.right(180); |
| + | turtle.forward(50); |
| + | dreh.q.zwanzig (500); |
</run> |