-3
canner Input = new Scanner(System.in);
int userNum;
int computerNum = (int) (0 + Math.random() * 3);
System.out.println("Let's play rock paper scissors.");
System.out.println("Choose rock paper or scissors");
boolean input = false;
String userInput = Input.nextLine();
do {
switch (userInput.toLowerCase().trim()) {
case "rock":
userNum = 0;
input = true;
break;
case "paper":
userNum = 1;
input = true;
break;
case "scissors:":
userNum = 2;
input = true;
break;
default:
System.out.println("Please retry and make sure spelling is correct");
input = false;
break;
}
} while (input = false);
有什麼不對?期望的行爲是什麼?您可能想閱讀[我如何提出一個好問題](http://stackoverflow.com/help/how-to-ask),這會增加獲得有用答案的可能性_drastically_。你可能會發現[ESR](https://en.m.wikipedia.org/wiki/Eric_S._Raymond)的優秀論文[如何提問智能方式](http://catb.org/~esr/) faqs/smart-questions.html)也很有幫助。 –
循環...........? –