Spiral starfield

First experiment

Log in to post a comment.

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

// Global code will be evaluated once.
const turtle = new Turtle();
turtle.penup();
turtle.goto(0, 0);
turtle.pendown();

// The walk function will be called until it returns false.
function walk(i) {
    let j = i - 100000 * Math.floor(i/100000);
    turtle.forward((1 + Math.sin(i/100))/2);
    turtle.right(0.02 + Math.exp(j/10000) + 0.1 * Math.round(Math.random()));
    return i < 1000000;
}