提交 e60078c6 编写于 作者: U u014301111

Sun Sep 15 14:00:00 CST 2024 inscode

上级 aca92922
...@@ -206,6 +206,7 @@ export function robotPlay(board, win_size) { ...@@ -206,6 +206,7 @@ export function robotPlay(board, win_size) {
* @param {PanInfo} pan_info 棋盘信息 * @param {PanInfo} pan_info 棋盘信息
* @param {number} row 行 * @param {number} row 行
* @param {number} col 列 * @param {number} col 列
* @param {}m {[number, number]} [y, x] 方向}
* @return {[number, number, number]} [空位数,棋子数,距离障碍物的距离] * @return {[number, number, number]} [空位数,棋子数,距离障碍物的距离]
*/ */
function getDirectionsInfo({ ROW, COL, OBJ }, row, col, [y, x], player) { function getDirectionsInfo({ ROW, COL, OBJ }, row, col, [y, x], player) {
...@@ -224,6 +225,7 @@ function getDirectionsInfo({ ROW, COL, OBJ }, row, col, [y, x], player) { ...@@ -224,6 +225,7 @@ function getDirectionsInfo({ ROW, COL, OBJ }, row, col, [y, x], player) {
const _inChessboard = inChessboard(ROW, COL) const _inChessboard = inChessboard(ROW, COL)
while (_inChessboard(_row, _col)) { while (_inChessboard(_row, _col)) {
const item = OBJ[`${_row}_${_col}`] const item = OBJ[`${_row}_${_col}`]
console.log(_row, _col);
if (item === villain) { if (item === villain) {
break; break;
...@@ -242,6 +244,7 @@ function getDirectionsInfo({ ROW, COL, OBJ }, row, col, [y, x], player) { ...@@ -242,6 +244,7 @@ function getDirectionsInfo({ ROW, COL, OBJ }, row, col, [y, x], player) {
obstacle_num += 1 obstacle_num += 1
} }
debugger
return [ return [
empty_num, empty_num,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册