Rock Paper Scissors Java game
<p>I am writing a Rock Paper Scissors Java game. Here is the code:</p>

<pre><code>import java.util.Scanner;
public class RPS {

   /**
   * @param args the command line arguments
   */
  public static void main(String[] args) {
      Scanner in = new Scanner(System.in);
      String personPlay; //Player A -- "R", "P", or "S"
      String secondUser; //Player B
      Scanner scan = new Scanner(System.in);
      System.out.println(" Player A enter R for Rock, P for Paper, S for Scissors: ");   //Get player's play -- note that this is stored as a string
      personPlay = scan.next();
       personPlay = personPlay.toUpperCase();
      System.out.println("Player B enter R for Rock, P for Paper, and S for Scissors");
      secondUser = scan.next();
      secondUser = secondUser.toUpperCase();


      if (personPlay.equals(secondUser)) {
          System.out.println("It's a tie!");
      } else if (personPlay.equals("r")) {
          if (secondUser.equals("s")) {
              System.out.println("Rock beats scissors! You win!");
          } else if (secondUser.equals("p")) {
              System.out.println("Paper eats Rock! You lose!");
          } else if (personPlay.equals("p")) {
              if (secondUser.equals("s")) {
                  System.out.println("Scissors cut Paper, you lose!");
              } else if (secondUser.equals("r")) {
                  System.out.println("Paper covers rock, you win!!");
              } else if (personPlay.equals("s")) {
                  if (secondUser.equals("p")) {
                      System.out.println("Scissors beat paper, you win!");
                  }
              } else if (secondUser.equals("r")) {
                  System.out.println("Rock beats Scissors, you lose!");
              }
          }
      }
  }
}
</code></pre>

<p>The winner is determined using an if-else block, however my if-else block does not seem to work. It only prints <strong>Its a tie!!</strong> What is the problem?</p>
