public static boolean check ( int x , int y , char val , char [ ] [ ] board ) {
  if ( board [ x ] [ y ] == '*' ) return true ;
  int mines = 0 ;
  for ( int [ ] dir : direction ) {
    int nx = x + dir [ 0 ] , ny = y + dir [ 1 ] ;
    if ( nx < 0 || nx >= board . length || ny < 0 || ny >= board [ 0 ] . length ) continue ;
    if ( board [ nx ] [ ny ] == '*' ) mines ++ ;
  };
}

public static boolean check ( int x , int y , char val , char [ ] [ ] board ) { if ( board [ x ] [ y ] == ' * ' ) return true ; int mines = 0 ; for ( int [ ] dir : direction ) { int nx = x + dir [ 0 ] , ny = y + dir [ 1 ] ; if ( nx < 0 || nx >= board . length || ny < 0 || ny >= board [ 0 ] . length ) continue ; if ( board [ nx ] [ ny ] == ' * ' ) mines ++ ; } ; }
(method_declaration (modifiers) type: (boolean_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (character_literal))) consequence: (return_statement (true))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (enhanced_for_statement type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier) value: (identifier) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal)))) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (identifier) right: (array_access array: (identifier) index: (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier)))) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (binary_expression left: (identifier) right: (field_access object: (array_access array: (identifier) index: (decimal_integer_literal)) field: (identifier))))) consequence: (continue_statement)) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (character_literal))) consequence: (expression_statement (update_expression (identifier))))))))