Approaching the golden ratio while building pentagrams out of it.
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 t = new Turtle();
t.penup();
t.goto(0,0);
t.pendown();
const fib = [1, 1];
function walk(i) {
const l = fib.length;
const lf = fib[l - 1];
const nf = fib[l] = lf + fib[l - 2];
t.forward(i*2);
t.right((nf / lf) * 89);
return i < 400;
}