@@ -20,7 +20,7 @@ var dummy = function(){
20
20
for ( var j = p - 1 ; j <= p + 1 ; j ++ ) {
21
21
var cell = _ ( 'cell-' + i + 'x' + j ) ;
22
22
if ( cell ) {
23
- if ( et . className . indexOf ( 'bomb' ) !== - 1 ) {
23
+ if ( cell . className . indexOf ( 'bomb' ) !== - 1 ) {
24
24
bombs ++ ;
25
25
}
26
26
}
@@ -33,13 +33,13 @@ var dummy = function(){
33
33
var gridHeight = document . grid . length ,
34
34
gridWidth = document . grid [ 0 ] . length ;
35
35
for ( var i = n - 1 ; i <= n + 1 ; i ++ ) {
36
+ if ( i < 1 || i > gridHeight ) continue ;
36
37
for ( var j = p - 1 ; j <= p + 1 ; j ++ ) {
37
- if ( p < 1 || p > gridWidth ) continue ;
38
- if ( n < 1 || n > gridHeight ) continue ;
38
+ if ( j < 1 || j > gridWidth ) continue ;
39
39
if ( p === j && n === i ) continue ;
40
40
var cell = _ ( 'cell-' + i + 'x' + j ) ;
41
41
if ( cell ) {
42
- if ( et . className . indexOf ( 'safe' ) === - 1 ) {
42
+ if ( cell . className . indexOf ( 'safe' ) === - 1 ) {
43
43
checkBombs ( { target :cell } ) ;
44
44
}
45
45
}
@@ -72,7 +72,7 @@ var dummy = function(){
72
72
}
73
73
} ;
74
74
window . addEventListener ( 'DOMContentLoaded' , function ( ) {
75
- return ;
75
+ // return;
76
76
document . grid = [
77
77
[ 'empty' , 'empty' , 'empty' , 'empty' , 'empty' , 'empty' , 'empty' , 'empty' ] ,
78
78
[ 'empty' , 'empty' , 'empty' , 'empty' , 'empty' , 'empty' , 'empty' , 'empty' ] ,
0 commit comments