diff --git a/README.md b/README.md index 7d0efc52..6c4d8851 100644 --- a/README.md +++ b/README.md @@ -1620,8 +1620,6 @@ here. * psycho-pass (Original Anime) - [Psycho-Pass Wiki](https://psychopass.fandom.com/wiki/Psycho-Pass_Wiki) * psycho-pass ([Crime Coefficient Levels Data](https://psychopass.fandom.com/wiki/Crime_Coefficient_(Index%29)) -- [PuKoren](https://github.com/PuKoren) - * nim ([AI Code](https://github.com/PuKoren/ai-nim/blob/master/main.cpp)) - [r/IsTodayFridayThe13th](https://www.reddit.com/r/IsTodayFridayThe13th/) * friday-the-13th (Concept) - [Random-d.uk](https://random-d.uk/) diff --git a/commands/games-mp/nim.js b/commands/games-mp/nim.js index 3eb80dff..e70086c7 100644 --- a/commands/games-mp/nim.js +++ b/commands/games-mp/nim.js @@ -11,14 +11,6 @@ module.exports = class NimCommand extends Command { group: 'games-mp', memberName: 'nim', description: 'Play a game of nim with another user or the AI.', - credit: [ - { - name: 'PuKoren', - url: 'https://github.com/PuKoren', - reason: 'AI Code', - reasonURL: 'https://github.com/PuKoren/ai-nim/blob/master/main.cpp' - } - ], args: [ { key: 'opponent', @@ -97,7 +89,7 @@ module.exports = class NimCommand extends Command { } const choice = turn.first().content; const picked = Number.parseInt(choice, 10); - if (choice.toLowerCase() === 'end') { + if (choice.toLowerCase() === 'end') { winner = userTurn ? opponent : msg.author; break; } @@ -203,10 +195,10 @@ module.exports = class NimCommand extends Command { for (let j = 1; j <= board[i]; j++) { board[i] -= j; const sum = this.xOr(board); - if (sum !== 0) { - board[i] += j; - } else { + if (sum === 0) { return [i, j]; + } else { + board[i] += j; } } }