my problem is that this is sound logic but the execution is incorrect (the submit server won't take it). So I'm trying to check if my hand of 5 cards has a straight (that's 2, 3, 4, ,5 6, etc. numbers in consecutive order) and then if the fifth card is an ace i want it to evaluate as the value 10 so it'd be like 6 7 8 9 A(A has a card value of 1) and this is my current code
public static boolean hasStraight(Card [] cards) {
boolean isTrue = false;
for(int atPos =0; atPos<cards.length-1; atPos++){
Card ogCard = cards[atPos];
Card notOgCard = cards[atPos+1];
if (ogCard.getValue() == (notOgCard.getValue()-1)){
if ((cards[3]).getValue()==9){
if (cards[4].getValue() ==1);
isTrue = true; //accounting for ace in last position
}
else if(ogCard.getValue() == (notOgCard.getValue()-1)){
isTrue = true; //accounting for ace not in first position
}
}
}
return isTrue;
}
this is what I have so far not sure what's next.