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