Tue Jun 27 10:14:00 UTC 2023 inscode

上级 14628132
...@@ -23,7 +23,7 @@ async function playChess(item, row, col) { ...@@ -23,7 +23,7 @@ async function playChess(item, row, col) {
lattices.value[row][col] = is_black lattices.value[row][col] = is_black
const test = checkWin({ row, col, board: lattices.value, player: is_black, win_size: win_size.value }) const test = checkWin({ row, col, board: lattices.value, player: is_black, win_size: win_size.value })
console.log(test) console.log(test)
if (test) { if (test.length >= win_size.value) {
isWin = test isWin = test
return return
} else { } else {
......
...@@ -48,7 +48,7 @@ export function checkWin({ row, col, board, player, win_size, direction }) { ...@@ -48,7 +48,7 @@ export function checkWin({ row, col, board, player, win_size, direction }) {
y -= dy; y -= dy;
} }
if (res.length >= win_size) { if (res.length < win_size) {
return res; // 出现五连珠,返回胜利 return res; // 出现五连珠,返回胜利
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册