Skip to content

Commit

Permalink
fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
mishoo committed Dec 18, 2015
1 parent fc7be9b commit f3d4776
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions minesweeper.js
Expand Up @@ -3,7 +3,7 @@ function Minesweeper(nrows, ncols) {
var board = new Array(boardLength); var board = new Array(boardLength);
var nbombs = 0; var nbombs = 0;
for (var i = boardLength; --i >= 0;) { for (var i = boardLength; --i >= 0;) {
var setBomb = Math.random() <= 0.2; var setBomb = Math.random() <= 0.15;
if (setBomb) { if (setBomb) {
nbombs++; nbombs++;
} }
Expand Down Expand Up @@ -75,8 +75,8 @@ function Minesweeper(nrows, ncols) {
var count = 0; var count = 0;
function add(dr, dc) { function add(dr, dc) {
var r = row + dr, c = col + dc; var r = row + dr, c = col + dc;
if (r >= 0 && r < nrows - 1 && if (r >= 0 && r < nrows &&
c >= 0 && c < ncols - 1 && c >= 0 && c < ncols &&
isBomb(r, c)) isBomb(r, c))
{ {
count++; count++;
Expand Down

0 comments on commit f3d4776

Please sign in to comment.