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();

// The walk function will be called until it returns false.

widths = [0.1, 0.2, 0.3, 0.4]

buffer_x = 8
buffer_y = -100
num_tiles = 25

function walk(i) {
    const x = i % num_tiles;
    const y = i / num_tiles >> 0;
    
    index = Math.floor(widths.length*Math.random())
    w = widths[index]
    
    for (let i = 0; i < 8; i++) {
        for(let j = 0; j < 8; j++){
            turtle.up();
                turtle.goto(
                buffer_y + x * buffer_x + j,
                buffer_y + y * buffer_x + i
                );
            turtle.down();
            
            
            turtle.circle(w);
            
        }
    };
    return i < num_tiles*num_tiles-1;
}