The sketched version
Log in to post a comment.
// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(-.3);
// Global code will be evaluated once.
const turtle = new Turtle();
turtle.radians();
// The walk function will be called until it returns false.
function walk(i) {
let r = ((.1 / (1 - Math.random())) * Math.SQRT2 * 80) + 20;
let t = Math.random() * 2 * Math.PI;
turtle.penup();
turtle.jump(Math.cos(t) * r, Math.sin(t) * r);
turtle.seth(t + (Math.PI / 2));
turtle.forward(10);
turtle.left(Math.PI);
turtle.pendown();
turtle.forward(20);
return i < 5000;
}