public static int DisCard ( int player ) {
  if ( player == 1 ) {
    if ( a . length ( ) == 0 ) {
      return 1 ;
    }
    else {
      char c = a . charAt ( 0 ) ;
      a = a . substring ( 1 ) ;
      if ( c == 'a' ) {
        return DisCard ( 1 ) ;
      }
      else if ( c == 'b' ) {
        return DisCard ( 2 ) ;
      }
      else {
        return DisCard ( 3 ) ;
      }
    }
  }
  else if ( player == 2 ) {
    if ( b . length ( ) == 0 ) {
      return 2 ;
    }
    else {
      char c = b . charAt ( 0 ) ;
      b = b . substring ( 1 ) ;
      if ( c == 'a' ) {
        return DisCard ( 1 ) ;
      }
      else if ( c == 'b' ) {
        return DisCard ( 2 ) ;
      }
      else {
        return DisCard ( 3 ) ;
      }
    }
  }
  else {
    if ( c . length ( ) == 0 ) {
      return 3 ;
    }
    else {
      char cha = c . charAt ( 0 ) ;
      c = c . substring ( 1 ) ;
      if ( cha == 'a' ) {
        return DisCard ( 1 ) ;
      }
      else if ( cha == 'b' ) {
        return DisCard ( 2 ) ;
      }
      else {
        return DisCard ( 3 ) ;
      }
    }
  }
}

public static int DisCard ( int player ) { if ( player == 1 ) { if ( a . length ( ) == 0 ) { return 1 ; } else { char c = a . charAt ( 0 ) ; a = a . substring ( 1 ) ; if ( c == ' a ' ) { return DisCard ( 1 ) ; } else if ( c == ' b ' ) { return DisCard ( 2 ) ; } else { return DisCard ( 3 ) ; } } } else if ( player == 2 ) { if ( b . length ( ) == 0 ) { return 2 ; } else { char c = b . charAt ( 0 ) ; b = b . substring ( 1 ) ; if ( c == ' a ' ) { return DisCard ( 1 ) ; } else if ( c == ' b ' ) { return DisCard ( 2 ) ; } else { return DisCard ( 3 ) ; } } } else { if ( c . length ( ) == 0 ) { return 3 ; } else { char cha = c . charAt ( 0 ) ; c = c . substring ( 1 ) ; if ( cha == ' a ' ) { return DisCard ( 1 ) ; } else if ( cha == ' b ' ) { return DisCard ( 2 ) ; } else { return DisCard ( 3 ) ; } } } }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (return_statement (decimal_integer_literal))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal)))))))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (return_statement (decimal_integer_literal))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal)))))))))) alternative: (block (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal))) consequence: (block (return_statement (decimal_integer_literal))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (character_literal))) consequence: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (block (return_statement (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal))))))))))))))