package Calismalarim;
import java.util.Scanner;
public class tas_kagit_makas {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
byte comp_score=0,user_score=0,user_turn,comp_turn;
while(comp_score!=3&&user_score!=3){
System.out.println("enter your choise:");
System.out.println("\t1->scissor\n\t2->rock\n\t3->paper");
user_turn=input.nextByte();
comp_turn=(byte)(1+Math.random()*3);
if(comp_turn==1&&user_turn==2){
System.out.println("computer choosed scissor");
System.out.println("user win");
if(comp_score!=0){
comp_score--;
user_score++;
}
else
user_score++;
}
else if(comp_turn==2&&user_turn==1){
System.out.println("computer choosed rock");
System.out.println("computer win");
if(user_score!=0){
comp_score++;
user_score--;
}
else
comp_score++;
}
else if(comp_turn==1&&user_turn==3){
System.out.println("computer choosed scissor");
System.out.println("computer win");
if(user_score!=0){
comp_score++;
user_score--;
}
else
comp_score++;
}
else if(comp_turn==3&&user_turn==1){
System.out.println("computer choosed paper");
System.out.println("user win");
if(comp_score!=0){
comp_score--;
user_score++;
}
else
user_score++;
}
else if(comp_turn==2&&user_turn==3){
System.out.println("computer choosed rock");
System.out.println("user win");
if(comp_score!=0){
comp_score--;
user_score++;
}
else
user_score++;
}
else if(comp_turn==3&&user_turn==2){
System.out.println("computer choosed paper");
System.out.println("computer win");
if(user_score!=0){
comp_score++;
user_score--;
}
else
comp_score++;
}
else if(comp_turn==3&&user_turn==3||comp_turn==1&&user_turn==1||comp_turn==2&&user_turn==2){
System.out.println("computer choosed the same one");
System.out.println("draw!!");
}
else{
System.out.println("wrong input");
continue;
}
System.out.println("|----score----|");
System.out.println("|user ->"+user_score+" |"+"\n|computer ->"+comp_score+" |");
System.out.println("|-------------|");
}
}
}