title: Create a program in Java that allows the user to play the Rock-Paper-Scissors game against the computer
body: <p>"Create a program in Java that allows the user to play the Rock-Paper-Scissors game against the computer". I'm new to Java, and I'm not sure what I'm doing wrong, as after it prompts the user to enter a response, nothing happens. Any help would be much appreciated! :)</p>
  
  <pre><code>     public class RockPaperScissors
           {
       public static void main(String[] args) 
             {   
      {
          Scanner scan = new Scanner(System.in);
          System.out.println("(R)ock, (P)aper, (S)cissors, or quit");
          String playersChoice = scan.nextLine(); 
      }
      String playersChoice = " " ,computerChoice;
  
      int wins = 0; 
      int losses = 0;
      int ties = 0; 
  
      while(!playersChoice.equals ("quit"))
      {
          if (playersChoice.equals("R") ||
          playersChoice.equals("P") ||
          playersChoice.equals("S"))
  
          {
              computerChoice = getComputerChoice();
  
              if (playersChoice.equals(computerChoice))
              {
                  System.out.println("Tie");
                  ties++;
              } 
              else {
  
                  boolean result = playerWins(playersChoice, computerChoice);
                  if (result == true)
                  {
                      wins++;
                      System.out.println("Your Point!");          
                      System.out.println(playersChoice + " beats " + 
                          computerChoice); 
                  }
                  else 
                  {
                      losses++; 
                      System.out.println("My Point!");  
                      System.out.println(computerChoice + " beats " + 
                          playersChoice); 
                  }
              }
  
  
  
              System.out.println("Invalid input.");
              System.out.println();   
          }
      }
  
      System.out.println("You won " + wins + " times.");
      System.out.println("You lost " + losses + " times." );
      System.out.println("We tied " + ties + " times." );      
  }
  
  public static String getComputerChoice() 
  {
      int randomInt;
  
      Random randomGenerator = new Random();
      randomInt = randomGenerator.nextInt(3);
  
      if (randomInt == 0) 
      {
          return "R";
      } 
      else if (randomInt == 1) 
      {
          return "P";
      } 
      else 
      {
          return "S";
      }
  }
  
  public static boolean playerWins(String playersChoice, 
  String computerChoice)
  {   
      boolean playerWins = false;
  
      if ((playersChoice.equals("R") &amp;&amp; computerChoice.equals("S")) ||
      (playersChoice.equals("P") &amp;&amp; computerChoice.equals("R")) ||
      (playersChoice.equals("S") &amp;&amp; computerChoice.equals("P")) ) 
      {
          playerWins = true;
      }
      else 
  
          playerWins = false;
  
      return playerWins; 
  }
  </code></pre>
  
  <p>}</p>