王一之 发表于 2024-10-23 16:24
哥哥把网址和脚本贴一下,我看看
https://puzzle.ggnb.top/block.html
我是在页面打断点,在调用drawSquare这个方法之前,用控制台重写了一下这个方法
let num = 0;
let sign = "";
drawSquare = function (x, y, size, color, borderColor, borderWidth){
context.fillStyle = color;
context.fillRect(x, y, size, size);
context.strokeStyle = borderColor;
context.lineWidth = borderWidth;
context.strokeRect(x, y, size, size);
if(sign.includes("【"+x+","+y+"】") == false){
sign = sign + "【"+x+","+y+"】"
num = num+1;
console.log(num);
console.log(sign);
}
}