Increase ITER to make it last longer
Decrease SPEED to make it go faster
Log in to post a comment.
// You can find the Turtle API reference here: https://turtletoy.net/syntax
Canvas.setpenopacity(0.03);
const ITER = 50000; // Increase me
const SPEED = 100;
// Global code will be evaluated once.
const turtle = new Turtle();
turtle.penup();
turtle.goto(-90,-25);
turtle.pendown();
/*
Sleep function from https://turtletoy.net/turtle/e99ca811ad
*/
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
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(180);
turtle.right(150+i*0.00000007);
if (i % 7 === 0) {
pausecomp(10 / SPEED);
}
return i < ITER;
}