-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)也很有帮助。 –
循环...........? –