public static void GuessByPlayer() {
System.out.print("=====================================\n"
+ ">猜数字>人机对战>玩家猜\n" + "=====================================\n"
+ "\t>>>>选择难度<<<<\n" + "\t 1. 普通 \n" + "\t 2. 困难 \n"
+ "\t 3. 返回\n" + "=====================================\n"
+ "请选择:");
String choice = new Scanner(System.in).next();
if ("1".equals(choice)) {
LocalGames lg = new LocalGames();
System.out
.println("\n\n\n\n=====================================\n"
+ "难度: 普通 \t\t能猜 15次\n"
+ "=====================================\n");
System.out.print("=====================================\n"
+ ">猜数字>人机对战>玩家猜\n" + "=====================================\n"
+ "\t>>>>选择难度<<<<\n" + "\t 1. 普通 \n" + "\t 2. 困难 \n"
+ "\t 3. 返回\n" + "=====================================\n"
+ "请选择:");
String choice = new Scanner(System.in).next();
if ("1".equals(choice)) {
LocalGames lg = new LocalGames();
System.out
.println("\n\n\n\n=====================================\n"
+ "难度: 普通 \t\t能猜 15次\n"
+ "=====================================\n");
boolean guess = lg.GuessByPlay(10);
System.out.println("\n=====================================\n"
+ "系统产生的随机数为:" + lg.getString(lg.randoms));
if (guess) {
System.out.println("恭喜您猜出来了! 您只猜测了 " + lg.C + " 次!");
} else {
System.out.println("很抱歉,您没能猜出来,此次猜数失败!");
}
System.out.print("=====================================\n"
+ "<任意键继续>\t\t");
choice = new Scanner(System.in).next();
if (!choice.equals(""))
GuessByPlayer();
} else if ("2".equals(choice)) {
LocalGames lg = new LocalGames();