Skip to content

Commit

Permalink
Remove bad early return
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldoylecs committed Dec 16, 2024
1 parent b990b63 commit befe16d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/minesweeper/minesweeper-game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,12 @@ export class MinesweeperGame {
const tile = this._board[x][y];

if (tile.isVisible) {
// If a revealed, number tile was clicked...
// If a revealed, non-flagged, number number tile was clicked...
if (!tile.isBomb && !tile.isFlagged && tile.adjacentBombCount > 0 && this.getAdjacentFlagCount(this._board, x, y) == tile.adjacentBombCount) {
this.revealHiddenNonflaggedNeighbors(this._board, x, y);
} else {
return;
}

// Ignore revealed tiles
return;
} else {
// Reveal the tile if not revealed yet
this._board[x][y].isVisible = true;
Expand Down

0 comments on commit befe16d

Please sign in to comment.