예제 #1
0
 private void addCardToScoreList(BlackJackCard card, ArrayList<Integer> scores) {
   if (scores.size() == 0) {
     scores.add(0);
   }
   int length = scores.size();
   for (int i = 0; i < length; i++) {
     int score = scores.get(i);
     scores.set(i, score + card.minValue());
     if (card.minValue() != card.maxValue()) {
       scores.add(score + card.maxValue());
     }
   }
 }
예제 #2
0
 public boolean isBlackJack() {
   if (cards.size() != 2) {
     return false;
   }
   BlackJackCard first = cards.get(0);
   BlackJackCard second = cards.get(1);
   return (first.isAce() && second.isFaceCard()) || (second.isAce() && first.isFaceCard());
 }