// 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, 0.1, 0.2, 0.3, 1] buffer_x = 14 buffer_y = -95 num_tiles = 14 small_tile_size = 10 function walk(i) { const x = i % num_tiles; const y = i / num_tiles >> 0; for (let i = 0; i < small_tile_size; i++) { for(let j = 0; j < small_tile_size; j++){ turtle.up(); turtle.goto( buffer_y + x * buffer_x + j, buffer_y + y * buffer_x + i ); turtle.down(); index = Math.floor(widths.length*Math.random()) w = widths[index] turtle.circle(w); } }; return i < num_tiles*num_tiles-1; }