Error Message: Exception in thread \"main\" java.lang.NumberFormatException: For input string: \"Ace of Clubs\" at java.lang.NumberFormatException.forInputString
Looks like cards[] is String array and you are trying to convert Ace of Clubs to Integer.
cards[]
Ace of Clubs
int first_value = Integer.parseInt(cards[index]);