This commit is contained in:
Dragon Fire
2021-01-15 19:57:31 -05:00
parent 1e7ce9cb5e
commit 3e69b0e855
+1 -3
View File
@@ -31,10 +31,9 @@ module.exports = class MinesweeperCommand extends Command {
try { try {
const game = new BombSweeper(size, size); const game = new BombSweeper(size, size);
game.PlaceBombs(size + 1); game.PlaceBombs(size + 1);
const taken = [];
let win = null; let win = null;
game.onWin = () => { win = true; }; game.onWin = () => { win = true; };
game.onLose = () => { win = false; }; game.onLoss = () => { win = false; };
while (!win) { while (!win) {
await msg.say(stripIndents` await msg.say(stripIndents`
${msg.author}, what coordinates do you pick (ex. 4,5)? Type \`end\` to forefeit. ${msg.author}, what coordinates do you pick (ex. 4,5)? Type \`end\` to forefeit.
@@ -68,7 +67,6 @@ module.exports = class MinesweeperCommand extends Command {
const coordPicked = choice.match(/(\d), ?(\d)/i) const coordPicked = choice.match(/(\d), ?(\d)/i)
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);
taken.push(`${x},${y}`);
game.CheckCell(x - 1, y - 1); game.CheckCell(x - 1, y - 1);
} }
this.client.games.delete(msg.channel.id); this.client.games.delete(msg.channel.id);