private static int recurse ( int x , int y , boolean [ ] [ ] vis , int [ ] [ ] dis ) {
  if ( x < 0 || x >= vis . length || y < 0 || y >= vis [ x ] . length || vis [ x ] [ y ] ) return 0 ;
  vis [ x ] [ y ] = true ;
  int res = 1 ;
  for ( int i = 0 ;
  i < 2 ;
  i ++ ) res += recurse ( x + dis [ i ] [ 0 ] , y + dis [ i ] [ 1 ] , vis , dis ) ;
  return res ;
}

private static int recurse ( int x , int y , boolean [ ] [ ] vis , int [ ] [ ] dis ) { if ( x < 0 || x >= vis . length || y < 0 || y >= vis [ x ] . length || vis [ x ] [ y ] ) return 0 ; vis [ x ] [ y ] = true ; int res = 1 ; for ( int i = 0 ; i < 2 ; i ++ ) res += recurse ( x + dis [ i ] [ 0 ] , y + dis [ i ] [ 1 ] , vis , dis ) ; return res ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (integral_type) name: (identifier)) (formal_parameter type: (array_type element: (boolean_type) dimensions: (dimensions)) name: (identifier)) (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (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: (identifier)) field: (identifier)))) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))) consequence: (return_statement (decimal_integer_literal))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (true))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal))) (binary_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal))) (identifier) (identifier)))))) (return_statement (identifier))))