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

// Global code will be evaluated once.
const mode = 0; // min=0 max=3 step=1 (Aquarelle,Perfect,Spirograph, Abstract)
const turtle = new Turtle();
turtle.jump(0, 17.3);

let max = 12 * Math.PI * (mode > 1? 200:500);

// The walk function will be called until it returns false.
function walk(i) {
    let t = i / (mode == 0? 5: mode==1? 50: mode==2?4: 1.61803398875); //last one is golden ratio
    let eq = Math.pow(Math.E, Math.cos(t)) - (2 * Math.cos(4*t)) - Math.pow(Math.sin(t/12), 5);
    let x = Math.sin(t) * eq;
    let y = Math.cos(t) * eq;
    turtle.goto(x * 24, 17.3 + (-y * 24));

    return i < max;
}