Javascript Turtle Graphics

// language reference forward(distance); right(angle); left(angle); goto(x,y); clear(); penup(); pendown(); reset(); angle(angle); width(width); color(r,g,b,a); write(string); n = random(low,high); hideTurtle(); showTurtle(); redrawOnMove(bool); draw(); repeat(n, action); wrap(bool); animate(action,ms); // (Windows) (OS X) // run: Ctrl+Enter Cmd+Enter // reset: Ctrl+Esc Cmd+Esc
// Write commands here. For example: function square(side) { repeat(4, function () { forward(side); right(90); }); } function demo() { hideTurtle(); color(0,0,255,1); for(s = 100; s > 0; s -= 10) { square(s); right(36); } } reset(); demo();

width: height:

render scale: