code = {
const A = (b) => Math.round(Math.random() * (b - 1)) * (360 / b);
let res = "";
for (let i = 0; i < rows; ++i) {
for (let j = 0; j < cols; ++j) {
const p = {
x: σ * w + j * σ * w * 2,
y: σ * w + σ * i * w * 2
};
res += `<use href="#t8" x="${p.x}" y="${p.y}" transform="rotate(${
0 + A(8)
}, ${p.x}, ${p.y})"/>
<use href="#t4" x="${p.x - σ * w}" y="${p.y - σ * w}" transform="rotate(${
45 + A(4)
}, ${p.x - σ * w}, ${p.y - σ * w})"/>`;
}
}
return res;
}