title: Rock Paper Scissors simple java using methods
body: <p>So my task today is to make a rock paper scissors game using methods. My first problem with my code is that I need it to ask the user if they want to play again or not. (y or n) Also, I need to implement scoring, 1 point if user wins, -1 if they lose, and for each time they play again add that score to total score. Any ideas on how to implement this? or what I need to change to my code. Also I am a rookie so sorry for the ugly formatting and feel free to critic every little detail, ill soak up all the information I can.</p>
  
  <pre><code> public static void main(String[] args){
   boolean tie = true;
      do{
          String computer = computerChoice();
          String user = userChoice();
          tie = (computer.compareTo(user) == 0);
          determineWinner(computer, user);
      }while(tie);
  
    }
  
    public static String computerChoice( ){
    Random rand = new Random();
   int cinput = rand.nextInt(3)+ 1;
    String computer = "thing";
    if (cinput == 1)
    computer = "Rock";
     if (cinput == 2)
    computer = "Paper";
   if (cinput == 3)
    computer = "Scissors";
      return computer;
    }
    public static String userChoice(){
    Scanner sc = new Scanner (System.in);
    String user = "default";
    do{
      System.out.println("choose your weapon(Paper,Scissors or Rock)");
      user = sc.nextLine();
    }
    while (isValidChoice (user) == false);
    return user;
    }
    public static boolean isValidChoice(String choice){
    boolean status;
    if (choice.compareTo("Rock")== 0)
      status = true;
    else if (choice.compareTo("Paper")== 0)
      status = true;
    else if (choice.compareTo("Scissors")== 0)
      status = true;
    else{
      status = false;
      System.out.println("Error! Make sure you are capitalizing your                    choices");
  }
  
  return status;
    }
    public static boolean determineWinner(String computer, String user){
    System.out.println (" Computer Choice: " + computer);
    System.out.println ("Your Choice : " + user);
    if (computer.compareTo( "Rock" ) == 0 &amp;&amp; user.compareTo  ("Scissors") == 0)
    System.out.println (" Computer wins! Better luck next time!");
    if (computer.compareTo("Scissors")== 0 &amp;&amp; user.compareTo("Paper") == 0)
    System.out.println (" Computer wins! Better luck next time!");
    if (computer.compareTo("Paper") == 0 &amp;&amp; user.compareTo("Rock") == 0)
    System.out.println (" Computer wins! Better luck next time!");
     if (computer.compareTo("Rock") == 0 &amp;&amp; user.compareTo("Paper") == 0)
     System.out.println (" You win!!");
    if (computer.compareTo("Scissors") == 0 &amp;&amp; user.compareTo("Rock") == 0)
    System.out.println (" You win!!");
    if (computer.compareTo("Paper") == 0 &amp;&amp; user.compareTo("Scissors") == 0)
    System.out.println (" You win!!");
    else if (computer.compareTo(user) == 0 ){
      System.out.println(" Tie! the game must be played again.");
      return false;
    }
    return true;
  }
  }
  </code></pre>
  
  <p>a output that my professor gave us as an example is:</p>
  
  <pre><code>Choose your weapon!
  1. Paper
  2. Scissors
  3. Rock
  5
   Choose your weapon!
   1. Paper
   2. Scissors
   3. Rock
    1
   You chose paper!
   I choose rock!
   I have been vanquished!
   We have matched wits 1 times, and your score is 1
   Do you want to play again (y or n)? y
   Choose your weapon!
   1. Paper
   2. Scissors
   3. Rock
   1
   You chose paper!
    I choose paper!
    We are equally matched. You are a worthy adversary.
    We have matched wits 2 times, and your score is 1
    Do you want to play again (y or n)? n
  </code></pre>