0
블랙 잭 게임을하려고하는데 11이 너무 높으면 "ACE"의 값을 1로 변경하는 방법을 모르겠습니다. 저는 이제 Arraylist를 찾아 A의 가치를 바꾸려고 노력하고 있습니다. 그러나 Arraylist에 얼마나 많은 A가 있는지 어떻게 알 수 있습니까?특정 요소에 대한 Arraylist 모양
while (getPointsPC() < 17 || getPointsPC() < getPointsPL()){
int acees = 0;
random = bj.getRandom();
CardsPC.add(bj.getCard(random));
setPointsPC(random);
lblPointsPC.setText("Points Dealer: " + Integer.toString(getPointsPC()));
String text = CardsPC.get(0);
for(int i = 1; i < CardsPC.size(); i++){
text = text + ", " + CardsPC.get(i);
}
if (CardsPC.contains("A") && getPointsPC() > 21 && acees < CardsPC.**HOW_MUCH_A's???**){
setPointsPC(13);
acees++;
}
lblCardsPC.setText(text);
}
내가 알고하지 않았다 "는 [엉덩이] (https://c1.staticflickr.com/3/2651/3892880140_52ec991129.jpg)"수 있었다. "ACE"를 원하셨습니까? – Andreas