diff --git a/src/App.vue b/src/App.vue index 106a6e218c4300007ee8e231c2387e05f0aa153c..5e5664e66c8d16a45e4448b37272fffa3db42b7f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -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 + // } } } diff --git a/src/utils/index.js b/src/utils/index.js index 5afa4fcdfbb3e57dd61cc30d3c74f325a5b451ea..235a08b73e2dc0e9f76f1b6a6114dfdcb4b7f358 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -133,6 +133,18 @@ function getDirectionScore(board, row, col, direction) { _col += y } } +/** + * 计分 + * 一颗棋子记 个位数 的积分 + * 两颗棋子记 十位数 的积分 + * 三颗棋子记 百位数 的积分 + * 以此类推 + * + * 是以一条线的记录积分,一个位置上正负方向为一条线 + * 当一个位置上 横 竖 斜 反斜 位置上都有棋子 + * 积分最多为 4 * (10**(8-1)) = 40000000 + * 积分最小为 4 * (10**(2-1)) = 40 + */ /** * 评估每个空位置的价值,从八个方向去计算,