import java.util.Scanner;
/**
- @author 康嘉富
- @date 2021/4/15 8:4
*/
public class main1 {
public static void main(String[] args) {
Scanner input = new Scanner
System.in);
Person o = new Person();
Computer on = new Computer();
int count = 0;
Person person;
Computer computer;
int sc;
int num = 0;
int x;
int sum = 0;
String name = "";
System.out.println("----------------歡迎進(jìn)入游戲世界---------------------");
System.out.println("\n");
System.out.println("\t\t*******************\t\t");
System.out.println("\t\t****\t猜拳,開始\t***\t\t");
System.out.println("\t\t*******************\t\t");
System.out.println("出拳規(guī)則:1.剪刀2.石頭3.布");
System.out.println("請選擇對方角色(1:劉備2:孫權(quán)3:曹操)");
x = input.nextInt();
String name1 = "";
switch (x) {
case 1:
name1 = "劉備";
System.out.println("你選擇了劉備對戰(zhàn)");
break;
case 2:
name1 = "孫權(quán)";
System.out.println("你選擇了孫權(quán)對戰(zhàn)");
break;
case 3:
name1 = "曹操";
System.out.println("你選擇了曹操對戰(zhàn)");
break;
}
System.out.println("請輸入你的姓名:");
String n = input.next();
System.out.println(n + "VS" + name1);
String con = "";
System.out.println("\n要開始碼?(y/n)");
con = input.next();
while (con.equals("y")) {
int perFist;
int compFist;
perFist = o.showFist();
compFist = on.showFist();
if ((perFist == 1 && compFist == 1)
|| (perFist == 2 && compFist == 2)
|| (perFist == 3 && compFist == 3)) {
System.out.println("結(jié)果:和局,真衰!\n");
} else if ((perFist == 1 && compFist == 3)
|| (perFist == 2 && compFist == 1)
|| (perFist == 3 && compFist == 2)) {
System.out.println("結(jié)果:恭喜,你贏了!");
num++;
} else {
System.out.println("結(jié)果說:_,你輸了,真笨!\n");
sum++;
}
count++;
System.out.println("\n是否開始下一輪(y/n):");
con = input.next();
}
System.out.println("------------------------------------------");
System.out.println(n + "VS" + name1);
System.out.println("對戰(zhàn)次數(shù):" + count);
System.out.println("姓名\t\t得分");
System.out.println(n + "\t\t" + num);
System.out.println(name1 + "\t\t" + sum);
if (sum < num) {
System.out.println("結(jié)果:恭喜");
} else if (sum == num) {
System.out.println("結(jié)果:還好,平局");
} else if (sum > num) {
System.out.println("結(jié)果:呵呵,笨笨,下次加油!");
}
System.out.println("------------------------------------------");
}
}