Sun Jul 2 08:04:03 UTC 2023 inscode

上级 c96a9811
......@@ -26,12 +26,12 @@ async function playChess(item, row, col) {
isWin = test
return
} else {
const [x, y] = robotPlay(lattices.value, is_white, win_size.value)
lattices.value[x][y] = is_white
const test = checkWin({ row: x, col: y, board: lattices.value, player: is_white, win_size: win_size.value })
if (test.length >= win_size.value) {
isWin = test
}
// const [x, y] = robotPlay(lattices.value, is_white, win_size.value)
// lattices.value[x][y] = is_white
// const test = checkWin({ row: x, col: y, board: lattices.value, player: is_white, win_size: win_size.value })
// if (test.length >= win_size.value) {
// isWin = test
// }
}
}
......
......@@ -133,6 +133,18 @@ function getDirectionScore(board, row, col, direction) {
_col += y
}
}
/**
* 计分
* 一颗棋子记 个位数 的积分
* 两颗棋子记 十位数 的积分
* 三颗棋子记 百位数 的积分
* 以此类推
*
* 是以一条线的记录积分,一个位置上正负方向为一条线
* 当一个位置上 横 竖 斜 反斜 位置上都有棋子
* 积分最多为 4 * (10**(8-1)) = 40000000
* 积分最小为 4 * (10**(2-1)) = 40
*/
/**
* 评估每个空位置的价值,从八个方向去计算,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册