Tue Jun 27 10:14:00 UTC 2023 inscode

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