Dragon curve

Dragon curve example.

#fractal #dragoncurve

Log in to post a comment.

// Global code will be evaluated once.
const turtle = new Turtle(-30,40);

// The walk function will be called until it returns false.
function walk(i) {
    turtle.forward(.2);
    turtle.circle((i & -i) << 1 & i ? -.5 : .5, 90);
    return i < (2<<12);
}