if(result == 1 || result == -2)
         {
System.out.println("Computer Win" + ComputerChoice);
         System.out.println(result);
           }

解决方案 »

  1.   

    我的意思是,如何让结果是:“ COMPUTER WIN, ROCK BEATS SCISSORS”
    而不仅仅是算术结果
      

  2.   

    String [] msg = {"rock","paper", "scissors"};
     ...
    System.out.println("Computer Win" + msg[(ComputerChoice + 3)%3] + " BEATS " + msg[(OurGuess + 3)%3]);
    ...
    // your logic seems wrong?
      

  3.   

    while(userPlay == 0 || userPlay == 1 || userPlay == 2){
    compPlay = generator.nextInt(3); if(userPlay == compPlay)
    outputString = "Wow... are you psychic?  Tie game.";
    else
    if(userPlay == 0 && compPlay == 1)
    outputString = "Your rock crumbles at the sight of the computers paper...";
    else
    if(userPlay == 0 && compPlay == 2)
    outputString = "Your rock crushes the computers silly scissors!";
    else
    if(userPlay == 1 && compPlay == 0)
    outputString = "You wrap your paper around the computers pebble of a rock!";
    else
    if(userPlay == 1 && compPlay == 2)
    outputString = "Your paper was cutoff by the computers scissors,..";
    else
    if(userPlay == 2 && compPlay == 0)
    outputString = "Your scissors are no match for good ol' rock... nothing beats rock";
    else
    if(userPlay == 2 && compPlay == 1)
    outputString = "Your scissors cut up the computer paper!";