【发布时间】:2016-10-05 17:41:52
【问题描述】:
我正在尝试玩二十一点游戏,但如果 11 太高,我不知道如何将“ACE”的值更改为 1。我现在正在尝试在 Arraylist 中搜索 A,以更改其中一个或多个的值。但是如何才能看到我的 Arraylist 中有多少 A?
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);
}
【问题讨论】:
-
我不知道“ASS”有号码。您指的是“ACE”吗?