import java.util.*;
public class PaperRockScissors {
public static void main (String[]args){
char p1, p2, repeat;
Scanner console= new Scanner(System.in);
System.out.print("Player1 turn: ");
p1= console.next().charAt(0);
System.out.print("Player2 turn: ");
p2= console.next().charAt(0);
do{
if (((p1 == 'r') || (p1== 'R')) && ((p2== 'r') || (p2== 'R')))
System.out.print("DRAW! Nobody wins.");
else if (((p1 == 'p') || (p1== 'P')) && ((p2== 'p') || (p2== 'P')))
System.out.print("DRAW! Nobody wins.");
else if (((p1 == 's') || (p1== 'S')) && ((p2== 's') || (p2== 'S')))
System.out.print("DRAW! Nobody wins. ");
//for scissors
else if (((p1 == 's') || (p1== 'S')) && ((p2== 'p') || (p2== 'P')))
System.out.print("Scissors cut the paper. Player1 wins!");
else if (((p1 == 'p') || (p1== 'P')) && ((p2== 's') || (p2== 'S')))
System.out.print("Scissors cut the paper. Player2 wins!");
//for paper
else if (((p1 == 'p') || (p1== 'P')) && ((p2== 'r') || (p2== 'R')))
System.out.print("Paper covers rock. Player1 wins!");
else if (((p1 == 'r') || (p1== 'R')) && ((p2== 'p') || (p2== 'P')))
System.out.print("Paper covers rock. Player2 wins!");
//for rock
else if (((p1 == 'r') || (p1== 'R')) && ((p2== 's') || (p2== 'S')))
System.out.print("Rock breaks scissors. Player1 wins!");
else if (((p1 == 's') || (p1== 'S')) && ((p2== 'r') || (p2== 'R')))
System.out.print("Rock breaks scissors. Player2 wins!");
//repeat
System.out.println("\nDo you wish to continue the game? \n Y-yes N-no: ");
repeat= console.next().charAt(0);
}
while((repeat=='y') || (repeat== 'Y'));
}
}