Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2016-06-09T08:32:19+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 width=800 height=800></canvas> | |
| − | <code id="57592993ba1e2"> |
| + | <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(a) ; | |
turtle.right(120) ; | |
turtle.forward(a) ; | |
turtle.right(120); | |
} | |
function haus(a) { | |
quadrat(a); | |
turtle.forward(a); | |
| − | turtle.right(90) |
| − | turtle.forward(a) |
| + | turtle.right(90) ; |
| + | turtle.forward(a) ; |
turtle.right(180); | |
dreieck(a); | |
} | |
function auto_q (a) { | |
for(i = 1; i < 5; i++ ) | |
{ turtle.forward(a); turtle.right(90); } | |
} | |
| − | function dreh.q.zwanzig (a) { |
| − | for(j = 1; j < 20; j++ ) |
| − | {auto_q (a); turtle.right (30) ; } |
| + | function drehqzwanzig (a) { |
| + | for(j = 1; j < 40; j++ ) |
| + | {auto_q (a) ; turtle.right (10) ; } |
} | |
| − | |
| − | |
| − | <run id="57592993ba259"> |
| + | </code> |
| + | <run id="57592a7c38dcb"> |
var c = new Canvas(1); | |
c.clear(); | |
turtle.home() ; | |
turtle.right(180); | |
turtle.forward(50); | |
dreh.q.zwanzig (500); | |
</run> |