mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Fix
This commit is contained in:
@@ -187,9 +187,9 @@ module.exports = class NimCommand extends Command {
|
|||||||
computerTurn(board) {
|
computerTurn(board) {
|
||||||
let clearRows = 0;
|
let clearRows = 0;
|
||||||
const unclearRows = [];
|
const unclearRows = [];
|
||||||
for (const row of board) {
|
for (let i = 0; i < board.length; i++) {
|
||||||
if (row === 0) clearRows++;
|
if (board[i] === 0) clearRows++;
|
||||||
else unclearRows.push(row);
|
else unclearRows.push(i);
|
||||||
}
|
}
|
||||||
if (unclearRows.length === 2) {
|
if (unclearRows.length === 2) {
|
||||||
const amount = board[unclearRows[0]] - 1;
|
const amount = board[unclearRows[0]] - 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user