This commit is contained in:
Dragon Fire
2021-01-15 20:57:34 -05:00
parent da61f3e839
commit 00eb4768fd
+3 -3
View File
@@ -48,8 +48,8 @@ module.exports = class MinesweeperCommand extends Command {
if (!coordPicked) return false; if (!coordPicked) return false;
const x = Number.parseInt(coordPicked[1], 10); const x = Number.parseInt(coordPicked[1], 10);
const y = Number.parseInt(coordPicked[2], 10); const y = Number.parseInt(coordPicked[2], 10);
console.log(game.mask[x - 1][y - 1]); console.log(game.mask[y - 1][x - 1]);
if (game.mask[x - 1][y - 1]) return false; if (game.mask[y - 1][x - 1]) return false;
return true; return true;
}; };
const turn = await msg.channel.awaitMessages(filter, { const turn = await msg.channel.awaitMessages(filter, {
@@ -92,7 +92,7 @@ module.exports = class MinesweeperCommand extends Command {
for (let i = 0; i < board.length; i++) { for (let i = 0; i < board.length; i++) {
str += nums[i]; str += nums[i];
board[i].forEach((item, j) => { board[i].forEach((item, j) => {
if (!mask || mask[i][j]) { if (!mask || mask[j][i]) {
if (item === '*') { if (item === '*') {
str += '💣'; str += '💣';
} else if (item === 0) { } else if (item === 0) {