Fairy lights

You can catch them in the garden after midnight.

Log in to post a comment.

Canvas.setpenopacity(-0.0125);

const turtle = new Turtle();
const iters = 3000;
let x = -100+200*Math.random(), y = -100+200*Math.random(), rem = 0.5;
let len, l;

function walk(i) {
    y = -100+200*Math.random()*Math.log10(200+x);
    x = -400/(1+Math.log10(200+y))+100+50*Math.random();
    turtle.penup();
    turtle.goto(x,y);
    turtle.pendown();
    len = 5+10*Math.random()*rem;
    for (l = len; l > 1; l*=0.999) {
        turtle.forward(l);
        turtle.right(rem*90+60*Math.sin(20*l));
    }
    rem = l;
    return i < iters;
}