const GAME_STATE = {
'board': [
[1, 1, 1],
[null, null, null],
[null, null, null]
],
'overControl': false
}
...
function lineControl() {
const { board } = GAME_STATE;
board[0].every(e => e === 1);
}
我正在尝试制作井字游戏,但我的lineControl()函数返回null
答案 0 :(得分:0)
像这样更改您的lineControl
函数
function lineControl() {
const { board } = GAME_STATE;
return board[0].every(e => e === 1);
}