When you click the green flag type rock or paper or scissors and then you might when, lose, or tie
I will give you some code (a little bit of code) import java.util.Scanner; import java.lang.Math; public class Rock { public static void main(String[] args) { String playerSelection; //User's play -- "R", "P", or "S" char playerPlay; //User's play -- 'R', 'P', or 'S' char computerPlay='?'; //Computer's play -- 'R', 'P', or 'S', based on computerInt int computerInt; //Randomly generated number used to determine computer's play boolean f; f = true; Scanner keyboard = new Scanner(System.in); playerPlay = 'f'; computerPlay = 'f'; while (f == true) { System.out.println("Please enter Rock, paper, Scissors, or Exit"); playerSelection = keyboard.nextLine(); playerSelection = playerSelection.toLowerCase(); if ( 0 == playerSelection.compareTo("rock")) { playerPlay = 'R'; } else if ( 0 == playerSelection.compareTo("paper")) { playerPlay = 'P'; } else if ( 0 == playerSelection.compareTo("scissors")) { playerPlay = 'S'; } else if (0 == playerSelection.compareTo("exit")) { System.out.println("have a good day! :)"); System.exit(1); } else { System.out.println("invalid input check for spelling error"); } computerInt =(int)(Math.random()*2.5)+1; if (computerInt == 1) { computerPlay = 'S'; } else if (computerInt == 2) { computerPlay = 'P'; } else if (computerInt == 3) { computerPlay = 'R'; } System.out.println("Computerplay is " + computerPlay); if (playerPlay == 'R' && computerPlay == 'S') { System.out.println("Rock crushes Scissors. YOU WON!!!!!"); } else if (playerPlay == 'S' && computerPlay == 'R') { System.out.println("Rock crushes Scissors. YOU lost!!!!!"); } else if (playerPlay == 'S' && computerPlay == 'P') { System.out.println("Scissors cut Paper. YOU Won!!!!!"); } else if (playerPlay == 'P' && computerPlay == 'S') { System.out.println("Scissors cut Paper. YOU Lost!!!!!"); } else if (playerPlay == 'P' && computerPlay == 'R') { System.out.println("Paper covers Rock. YOU Won!!!!!"); } else if (playerPlay == 'R' && computerPlay == 'P') { System.out.println("Paper covers Rock. YOU lost!!!!!"); } else { System.out.println("It's a tie"); } } } }