if (over){ return; },这段代码的效果是什么
不懂这段代码的含义
chess.onclick = function(e){
if (over){
return;
}
var x = e.offsetX;
var y = e.offsetY;
var i = Math.floor(x/30);
var j = Math.floor(y/30);
if(chessBoard[i][j]==0){
oneStep(i,j,me);
if(me){
chessBoard[i][j]=1;
}else{
chessBoard[i][j]=2;
}
me = !me;
for (var k=0;k<count;k++){
if(wins[i][j][k]){
myWin[k]++;
computerWin[k] = 6;
if(myWin[k]==5){
window.alert("你赢了");
over = true;
}
}
}
}
}
代码在上面,请问效果是什么?