凉心赌场

answer = input('欢迎进入澳门赌场\n确定进入游戏吗(y / n)')
m = 0
t = '金币不足 100元10个币,必须是100的倍数):'
r = '是否充值(y / n)'
if answer == 'y':
    while True:
        n = int(input(t))
        if n % 100 == 0 and n != 0:
            m = (n // 100) * 10
        print('当前币为:{},一局需要2个币'.format(m))
        while m > 2:
            import random

            t1 = random.randint(1, 6)
            t2 = random.randint(1, 6)
            guess = input('大或小:')
            m -= 2  # 凉心赌场
            print('金币少2个')
            if ((t1 + t2) >= 6 and guess == '大') or (6 > (t1 + t2) and guess == '小'):
                m += 1  # 凉心赌场
                print('获得1个金币,目前为:', m)
                if m == 2:
                    print('金币不足')
                    choose = input(r)
                    if choose == 'y':
                        n = int(input(t))
                        m1 = (n // 100) * 10
                        m += m1
                        print('目前金币为:{}'.format(m))
                    else:
                        break

你可能感兴趣的:(凉心赌场)