As usual i've waited until the last minute to work on this and now i'm stuck.
I'm not sure what is causing the error.
Any help would be greatly appreciated.
PS i'm not very Java savvy so maybe dumb down the explanations a little?
thanks
/****************** *R/P/S Program *Eddy Caraballo ******************/ import java.util.Scanner; import java.util.Random; public class RockPaperScissors { public static void main (String[] args) { int cChoice; // variable for computers choice (R/P/S) int pChoice = 0; // Holds converted choice (R=1, P=2, S=3) int cScore = 0, pScore = 0, tie = 0, rounds = 0; // Initialised variables for score keeping (c = computer, p = player) plus keeps track of number of rounds played String loop="yes"; // Starts our loop Scanner input = new Scanner(System.in); // Creates scanner object Random rgen = new Random(); System.out.println("Rock-Paper-Scissors time! (sung like peanut butter jelly time)"); while (loop.equals("yes")) // This loop keeps our game going only while our string.loop is equal to 'yes' { cChoice=rgen.nextInt(3)+1; System.out.println("Enter Rock, Paper or Scissors"); String pInput = input.nextLine(); // variable for players choice (R/P/S) if (pChoice.equals("Rock") || pChoice.equals("Paper") || pChoice.equals("Scissors")) // Ensures player has entered the correct choice for the game to continue { System.out.println(""); if (pChoice.equals("Rock")) // This converts pChoice to the numeric value for "Rock" { pChoice = 1; } if (pChoice.equals("Paper")) // This converts pChoice to the numeric value for "Rock" { pChoice = 2; } if (pChoice.equals("Scissors")) // This converts pChoice to the numeric value for "Rock" { pChoice = 3; } if (pChoice == cChoice) // Takes care of Ties { System.out.println("Tie Game!"); System.out.println(""); tie++; rounds++; } else // Accounts for scoring for non-tie scenarios { if (cChoice==1 && pChoice==3) // Computer picks Rock and player has Scissors - adds point to score and rounds { System.out.println("Computer picked Rock!"); System.out.println("Rock beats Scissors!"); System.out.println("**Computer Wins!**"); System.out.println(""); cScore++; rounds++; } if (cChoice==1 && pChoice==2) // Computer picks Rock and player has Paper - adds point to score and rounds { System.out.println("Computer picked Rock!"); System.out.println("Paper beats Rock!"); System.out.println("**Player Wins!**"); System.out.println(""); pScore++; rounds++; } if (cChoice==2 && pChoice==3) // Computer picks Paper and player has Scissors - adds point to score and rounds { System.out.println("Computer picked Paper!"); System.out.println("Scissors beats Paper!"); System.out.println("**Player Wins!**"); System.out.println(""); pScore++; rounds++; } if (cChoice==2 && pChoice==1) // Computer picks Paper and player has Rock - adds point to score and rounds { System.out.println("Computer picked Paper!"); System.out.println("Paper beats Rock!"); System.out.println("**Computer Wins!**"); System.out.println(""); cScore++; rounds++; } if (cChoice==3 && pChoice==1) // Computer picks Scissors and player has Rock - adds point to score and rounds { System.out.println("Computer picked Scissors!"); System.out.println("Rock beats Scissors!"); System.out.println("**Player Wins!**"); System.out.println(""); pScore++; rounds++; } if (cChoice==3 && pChoice==2) // Computer picks Scissors and player has Paper - adds point to score and rounds { System.out.println("Computer picked Scissors!"); System.out.println("Scissors beats Paper!"); System.out.println("**Computer Wins!**"); System.out.println(""); cScore++; rounds++; } } } else // end the game { System.out.println ("Sorry, you didn't pick Rock, Paper, or Scissors. The game will end now."); System.out.println ("Here are the final scores after " + rounds +" rounds:"); System.out.println ("You\tComputer\tTies"); System.out.println (" "+ pScore +"\t " + cScore + "\t\t " + tie); loop = "no"; // terminates the while loop keeping the game going } } } }