Playing with variables
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();
const size=100; // min=1 max=200 step=1
const angle=144; // min=1 max=360 step=1
const number=4; // min=1 max=100 step=1
turtle.penup();
turtle.goto(-50,-20);
turtle.pendown();
// The walk function will be called until it returns false.
function walk(i) {
turtle.forward(size);
turtle.right(angle);
return i < number;
}