0
爲Blackjack製作一個簡單的Java代碼並需要一些建議。同時在Blackjack中提問
好吧我正在嘗試使這個循環,並停止當我說「留」 任何建議?
while (name4.equals("stay"))
{
System.out.print("Would you like to hit or stay? ");
String name4 = keyboard.next();
total2 = total+number4;
number4 = random.nextInt(9)+2;
System.out.println("You drew a " + number4 + ". ");
System.out.println("Your total is " + (total + number4) + ". ");
if (total == 21)
{
System.out.print("YOU WIN!");
}
}