package edu.xcdq;
import java.util.Scanner;
public class Game<Person> {
Person a;
Computer b;
int count;
public void initial(){
a = new Person();
b = new Computer();
count = 0;
}
public void StartGame(){
Scanner input = new Scanner(System.in);
System.out.println("-----------歡迎進入游戲世界------------");
System.out.println(" ");
System.out.println(" ");
System.out.println("\t\t\t************");
System.out.println("\t\t\t*****猜拳斯嚎,開始********");
System.out.println("\t\t\t*************");
System.out.println(" ");
System.out.println(" ");
System.out.println("出拳規(guī)則: 1.剪刀 2.石頭 3.布");
System.out.println("請輸入你的姓名:");
String Playname = input.next(); // 玩家姓名
System.out.println("請選擇對方角色(1.劉備 2.孫權(quán) 3.曹操)");
int f = input.nextInt();
String Computername = "";
switch (f){
case 1:
Computername = "劉備";
break;
case 2:
Computername = "孫權(quán)";
break;
case 3:
Computername = "曹操";
break;
}
System.out.println("您選擇了" + Computername + "對戰(zhàn)");
System.out.println(" ");
System.out.println("要開始嗎银还? (y/n)");
String con = input.next();
int m;
int n;
int x = 0;
int y = 0;
int z = 0;
String can;
if (con.equals("y")){
do {
m = a.showFist();
n = b.showtwo();
if ((m == 1&&n == 1)|| (m == 2&& n == 2)|| (m == 3&&n ==3)){
System.out.println("結(jié)果: 和局,真衰!搂漠!");
x++;
} else if (m == 1&&n == 1)|| (m == 2&& n == 2)|| (m == 3&&n ==3)){
System.out.println("結(jié)果:恭喜你,你贏了!!");
y++;
}
}
}
}
}