plaid donut

plaid donut

Log in to post a comment.

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

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

function ngon(n,l) {
    for (i = 0; i < n; i++) {
        turtle.forward(l)
        turtle.right(360/n)
    }
}

function pausecomp(millis)
{
    var date = new Date();
    var curDate = null;
    do { curDate = new Date(); }
    while(curDate-date < millis);
}

// The walk function will be called until it returns false.
function walk(i) {
    turtle.forward(5)
    turtle.right(17)
    turtle.forward(20)
    ngon(50,6)
    pausecomp(20)
    return i < 300;
}