Spiral

A simple spiral

Log in to post a comment.

// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(1);

// Global code will be evaluated once.
const turtle = new Turtle();
const max = 1000 //min=100 max=500000 step=1
n = 0;
turtle.penup();
turtle.goto(-80,-90);
turtle.pendown();

// The walk function will be called until it returns false.
function walk(i) {
turtle.forward(2);
turtle.right(0.5 + n);
n = n + 0.008;
return i < max
}