From 5ef8c6764e9642cbc9b9d3b3d82f31a6462ad494 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 15 Jan 2021 19:44:25 -0500 Subject: [PATCH] Fix --- commands/games-sp/minesweeper.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/commands/games-sp/minesweeper.js b/commands/games-sp/minesweeper.js index 3cfccfbb..da72f503 100644 --- a/commands/games-sp/minesweeper.js +++ b/commands/games-sp/minesweeper.js @@ -86,21 +86,23 @@ module.exports = class MinesweeperCommand extends Command { displayBoard(board, mask) { let str = ''; - str += '⬜⬜'; + str += '⬛⬛'; str += nums.slice(0, board.length).join(''); - str += '\n⬜\n'; + str += `\n⬛${'⬛'.repeat(board.length)}\n`; for (let i = 0; i < board.length; i++) { str += nums[i]; - str += '⬜'; + str += '⬛'; board[i].forEach((item, j) => { - if (mask[i][j] === 'F') { - str += '❓'; - } else if (item === '*') { - str += '💣'; - } else if (item === 0) { - str += '⬜'; + if (mask[i][j]) { + if (item === '*') { + str += '💣'; + } else if (item === 0) { + str += '⬜'; + } else { + str += nums[item - 1]; + } } else { - str += nums[item - 1]; + str += '❓'; } }); str += '\n';