diff options
-rw-r--r-- | apps/plugins/minesweeper.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/plugins/minesweeper.c b/apps/plugins/minesweeper.c index b3effdf328..d8313fb741 100644 --- a/apps/plugins/minesweeper.c +++ b/apps/plugins/minesweeper.c | |||
@@ -523,7 +523,9 @@ static void minesweeper_init( void ) | |||
523 | 523 | ||
524 | /* put mines on the mine field */ | 524 | /* put mines on the mine field */ |
525 | /* there is p% chance that a tile is a mine */ | 525 | /* there is p% chance that a tile is a mine */ |
526 | /* if the tile has coordinates (x,y), then it can't be a mine */ | 526 | /* if the tile has coordinates (x,y), or is adjacent to those, |
527 | * then it can't be a mine because that would reduce the game | ||
528 | * from a logic game to a guessing game. */ | ||
527 | static void minesweeper_putmines( int p, int x, int y ) | 529 | static void minesweeper_putmines( int p, int x, int y ) |
528 | { | 530 | { |
529 | int i,j; | 531 | int i,j; |
@@ -533,7 +535,8 @@ static void minesweeper_putmines( int p, int x, int y ) | |||
533 | { | 535 | { |
534 | for( j = 0; j < width; j++ ) | 536 | for( j = 0; j < width; j++ ) |
535 | { | 537 | { |
536 | if( rb->rand()%100 < p && !( y==i && x==j ) ) | 538 | if( rb->rand()%100 < p |
539 | && !( i>=y-1 && i<=y+1 && j>=x-1 && j<=x+1 ) ) | ||
537 | { | 540 | { |
538 | minefield[i][j].mine = 1; | 541 | minefield[i][j].mine = 1; |
539 | mine_num++; | 542 | mine_num++; |