//2018.12.27 赌筛子游戏
import java.util.Scanner;
public class Plan {
public static void main(String[] arge) {
Scanner sc=new Scanner(System.in); //代表键盘
int money = 1000;
//开始游戏界面
System.out.println("************"+"欢迎来到小郑大赌场"+"************");
System.out.println("是否开始游戏:yes/no");
while(true) {
String plan = sc.nextLine();
if(!"no".equals(plan)) {
//玩家选择no则游戏结束
System.out.println("请开始下注:");
int pay = sc.nextInt();
if(pay>money) {
System.out.println("余额不足");
continue;
}
// 生成三个随机的筛子
int a = (int)(Math.random()*6)+1;
int b = (int)(Math.random()*6)+1;
int c = (int)(Math.random()*6)+1;
//开始选择压大压小
String result = (a+b+c)>9?"大":"小";
System.out.println("请压大小:");
String guess = sc.next();
if(result.equals(guess)) {
money += pay;
System.out.println(a+","+b+","+c);
System.out.println("恭喜您压中了");
System.out.println("账户余额为:"+money);
}else {
money -= pay;
System.out.println(a+","+b+","+c);
System.out.println("很遗憾您未压中");
System.out.println("账户余额为:"+money);
System.out.println("欢迎下次来玩");
}
if(money<=0) {
System.out.println("余额不足是否考虑充值是:是/否");
String whether = sc.next();
if(!"否".equals(whether)) {
System.out.println("充值的金额为:");
money = sc.nextInt();
System.out.println("余额为:"+money);
continue;
}else {
System.out.println("余额不足");
break;
}
}
}
}
}
}