Horje
rock paper scissor in java Code Example
rock paper scissor in java
if (personPlay.equals(computerPlay)) {
   System.out.println("It's a tie!");
}
else if (personPlay.equals("R")) {
   if (computerPlay.equals("S")) 
      System.out.println("Rock crushes scissors. You win!!");
   else if (computerPlay.equals("P")) 
        System.out.println("Paper eats rock. You lose!!");
}
else if (personPlay.equals("P")) {
   if (computerPlay.equals("S")) 
       System.out.println("Scissor cuts paper. You lose!!"); 
   else if (computerPlay.equals("R")) 
        System.out.println("Paper eats rock. You win!!");
} 
else if (personPlay.equals("S")) {
     if (computerPlay.equals("P")) 
         System.out.println("Scissor cuts paper. You win!!"); 
     else if (computerPlay.equals("R")) 
        System.out.println("Rock breaks scissors. You lose!!");
}
else 
     System.out.println("Invalid user input.");




Java

Related
how to add an image to a gui in java windowbuilder Code Example how to add an image to a gui in java windowbuilder Code Example
java base64 decrypt script Code Example java base64 decrypt script Code Example
Java 8 merge 2 collections. Code Example Java 8 merge 2 collections. Code Example
spring boot swagger ui 401 Code Example spring boot swagger ui 401 Code Example
get spring application context Code Example get spring application context Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8