mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Fix
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user