当前位置: 首页 > article >正文

博饼代码【Python】

四年级时候写的,具有一些奖惩功能,当时不会函数,写得又臭又长,现在转战c++,看不懂了,直接发出来当做回忆吧,需要的直接复制即可

import easygui
import turtle
import random
import time
import math

#开始进入Python的世界
easygui.msgbox('欢迎来玩博饼!')
easygui.msgbox('规则如下:选择倍数,博到什么等级就有对应的奖励乘上倍数')
easygui.msgbox('初始钱数300')
t = turtle.Turtle()
t.speed(0)
t.shape('turtle')
# f = random.randint(1, 6)
ks = 0
b = 200
cp = 0
cp1 = 0
cp2 = 0
cp3 = 0
cp4 = 0
cp5 = 0
cp6 = 0
cp7 = 0
cp8 = 300
cp9=0
# while 语句
while ((cp8 > 49)):
    cp9 = 0
    while(((cp9<=0)or(cp8-cp9*50<=0))):
        cp9 = ((turtle.textinput('对话框', '请输入倍数')))
        cp9 =int(cp9)
        if((cp9 > 0) and (cp8-cp9*50 <= 0)):
            easygui.msgbox('失败','Codemao','知道啦') 
        else:
            easygui.msgbox('成功','Codemao','知道啦') 
            cp9=int(cp9)


    cp8 -= 50*cp9
    t.penup()
    t.goto((-200), 0)
    t.pendown()
    # 随机
    a = random.randint(1, 6)
    # 随机
    a2 = random.randint(1, 6)
    # 随机
    a3 = random.randint(1, 6)
    # 随机
    a4 = random.randint(1, 6)
    # 随机
    a5 = random.randint(1, 6)
    # 随机
    a6 = random.randint(1, 6)
    '''
    a = 4
    a2 = 4
    a3 = 4
    a4 = 5
    a5 = 6
    a6 = 1
    '''
    # 正方形框
    for i in range(4):
        t.forward(150)
        t.right(90)
    t.penup()
    # 点数1
    if (a == 1):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-125), (-85))
        t.circle(20)
        t.end_fill()
    # 点数2
    if (a == 2):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90), (-75))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-155), (-75))
        t.circle(10)
        t.end_fill()
    # 点数3
    if (a == 3):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125), (-75))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90), (-100))
        t.circle(10)
        t.end_fill()
    # 点数4
    if (a == 4):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100), (-120))
        t.circle(10)
        t.end_fill()
    # 点数5
    if (a == 5):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125), (-85))
        t.circle(10)
        t.end_fill()
    # 点数6
    if (a == 6):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-80), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-85), (-120))
        t.circle(10)
        t.end_fill()
    # 筛子2
    # 正方形框
    t.penup()
    t.goto((-200 + b), 0)
    t.pendown()
    for i in range(4):
        t.forward(150)
        t.right(90)
    t.penup()
    # 点数1
    if (a2 == 1):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-125 + b), (-85))
        t.circle(20)
        t.end_fill()
    # 点数2
    if (a2 == 2):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90 + b), (-75))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-155 + b), (-75))
        t.circle(10)
        t.end_fill()
    # 点数3
    if (a2 == 3):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125 + b), (-75))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90 + b), (-100))
        t.circle(10)
        t.end_fill()
    # 点数4
    if (a2 == 4):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160 + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100 + b), (-120))
        t.circle(10)
        t.end_fill()
    # 点数5
    if (a2 == 5):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160 + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100 + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125 + b), (-85))
        t.circle(10)
        t.end_fill()
    # 点数6
    if (a2 == 6):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-80 + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180 + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130 + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-85 + b), (-120))
        t.circle(10)
        t.end_fill()
    # 筛子3
    # 正方形框
    t.penup()
    t.goto(((-200 + b) + b), 0)
    t.pendown()
    for i in range(4):
        t.forward(150)
        t.right(90)
    t.penup()
    # 点数1
    if (a3 == 1):
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-125 + b) + b), (-85))
        t.circle(20)
        t.end_fill()
    # 点数2
    if (a3 == 2):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-90 + b) + b), (-75))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-155 + b) + b), (-75))
        t.circle(10)
        t.end_fill()
    # 点数3
    if (a3 == 3):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-125 + b) + b), (-75))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-90 + b) + b), (-100))
        t.circle(10)
        t.end_fill()
    # 点数4
    if (a3 == 4):
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
    # 点数5
    if (a3 == 5):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-125 + b) + b), (-85))
        t.circle(10)
        t.end_fill()
    # 点数6
    if (a3 == 6):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-180 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-130 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-80 + b) + b), (-50))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-180 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-130 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-85 + b) + b), (-120))
        t.circle(10)
        t.end_fill()
        t.penup()
    # 筛子4
    t.penup()
    t.goto((-200), (0 + b))
    t.pendown()
    # 正方形框
    for i in range(4):
        t.forward(150)
        t.right(90)
    t.penup()
    # 点数1
    if (a4 == 1):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-125), (-85 + b))
        t.circle(20)
        t.end_fill()
    # 点数2
    if (a4 == 2):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90), (-75 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-155), (-75 + b))
        t.circle(10)
        t.end_fill()
    # 点数3
    if (a4 == 3):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125), (-75 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90), (-100 + b))
        t.circle(10)
        t.end_fill()
    # 点数4
    if (a4 == 4):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100), (-120 + b))
        t.circle(10)
        t.end_fill()
    # 点数5
    if (a4 == 5):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125), (-85 + b))
        t.circle(10)
        t.end_fill()
    # 点数6
    if (a4 == 6):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-80), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-85), (-120 + b))
        t.circle(10)
        t.end_fill()
    # 筛子5
    # 正方形框
    t.penup()
    t.goto((-200 + b), (0 + b))
    t.pendown()
    for i in range(4):
        t.forward(150)
        t.right(90)
    t.penup()
    # 点数1
    if (a5 == 1):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-125 + b), (-85 + b))
        t.circle(20)
        t.end_fill()
    # 点数2
    if (a5 == 2):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90 + b), (-75 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-155 + b), (-75 + b))
        t.circle(10)
        t.end_fill()
    # 点数3
    if (a5 == 3):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125 + b), (-75 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-90 + b), (-100 + b))
        t.circle(10)
        t.end_fill()
    # 点数4
    if (a5 == 4):
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-160 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto((-100 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
    # 点数5
    if (a5 == 5):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-160 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-100 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-125 + b), (-85 + b))
        t.circle(10)
        t.end_fill()
    # 点数6
    if (a5 == 6):
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-80 + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-180 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-130 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto((-85 + b), (-120 + b))
        t.circle(10)
        t.end_fill()
    # 筛子6
    # 正方形框
    t.penup()
    t.goto(((-200 + b) + b), (0 + b))
    t.pendown()
    for i in range(4):
        t.forward(150)
        t.right(90)
    t.penup()
    # 点数1
    if (a6 == 1):
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-125 + b) + b), (-85 + b))
        t.circle(20)
        t.end_fill()
    # 点数2
    if (a6 == 2):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-90 + b) + b), (-75 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-155 + b) + b), (-75 + b))
        t.circle(10)
        t.end_fill()
    # 点数3
    if (a6 == 3):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-125 + b) + b), (-75 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-90 + b) + b), (-100 + b))
        t.circle(10)
        t.end_fill()
    # 点数4
    if (a6 == 4):
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('red')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
    # 点数5
    if (a6 == 5):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-160 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-100 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-125 + b) + b), (-85 + b))
        t.circle(10)
        t.end_fill()
    # 点数6
    if (a6 == 6):
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-180 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-130 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-80 + b) + b), (-50 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-180 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-130 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
        t.fillcolor('black')
        t.begin_fill()
        t.goto(((-85 + b) + b), (-120 + b))
        t.circle(10)
        t.end_fill()
    ks += 1
    t.hideturtle()
    h = (a,a2,a3,a4,a5,a6)
    y = 0
    e = 0
    s = 0
    s1 = 0
    w = 0
    l = 0
    # 4
    if (a == 4):
        s1 += 1
    if (a2 == 4):
        s1 += 1
    if (a3 == 4):
        s1 += 1
    if (a4 == 4):
        s1 += 1
    if (a5 == 4):
        s1 += 1
    if (a6 == 4):
        s1 += 1
    # 1
    if (a == 1):
        y += 1
    if (a2 == 1):
        y += 1
    if (a3 == 1):
        y += 1
    if (a4 == 1):
        y += 1
    if (a5 == 1):
        y += 1
    if (a6 == 1):
        y += 1
    # 2
    if (a == 2):
        e += 1
    if (a2 == 2):
        e += 1
    if (a3 == 2):
        e += 1
    if (a4 == 2):
        e += 1
    if (a5 == 2):
        e += 1
    if (a6 == 2):
        e += 1
    # 3
    if (a == 3):
        s += 1
    if (a2 == 3):
        s += 1
    if (a3 == 3):
        s += 1
    if (a4 == 3):
        s += 1
    if (a5 == 3):
        s += 1
    if (a6 == 3):
        s += 1
        # 5
    if (a == 5):
        w += 1
    if (a2 == 5):
        w += 1
    if (a3 == 5):
        w += 1
    if (a4 == 5):
        w += 1
    if (a5 == 5):
        w += 1
    if (a6 == 5):
        w += 1
        # 6
    if (a == 6):
        l += 1
    if (a2 == 6):
        l += 1
    if (a3 == 6):
        l += 1
    if (a4 == 6):
        l += 1
    if (a5 == 6):
        l += 1
    if (a6 == 6):
        l += 1
    # 判断
    g = (y,e,s,s1,w,l)
    print(g)
    if (s1 >= 4 or y >= 5 or e >= 5 or s >= 5 or w >= 5 or l >= 5):
        if (y == 2):
            t.penup()
            t.goto((-300), 300)
            t.write("状元插金花", align="right", font=("楷体", 16, "bold"))
            cp += 1
            cp8 += 1000*cp9
        else:
            t.penup()
            t.goto((-300), 300)
            t.write("状元", align="right", font=("楷体", 16, "bold"))
            cp1 += 1
            cp8 += 500*cp9
    elif (y == 4 or e == 4 or s == 4 or w == 4 or l == 4):
        if (s1 == 2):
            t.penup()
            t.goto((-300), 300)
            t.write("四进带二举", align="right", font=("楷体", 16, "bold"))
            cp5 += 1
            cp8 += 100*cp9
        elif (s1 == 1):
            t.penup()
            t.goto((-300), 300)
            t.write("四进带一秀", align="right", font=("楷体", 16, "bold"))
            cp6 += 1
            cp8 += 50*cp9
        else:
            t.penup()
            t.goto((-300), 300)
            t.write("四进", align="right", font=("楷体", 16, "bold"))
            cp3 += 1
        cp8 += 200*cp9
    elif (s1 == 3):
        t.penup()
        t.goto((-300), 300)
        t.write("三红", align="right", font=("楷体", 16, "bold"))
        cp4 += 1
        cp8 += 300*cp9
    elif (s1 == 2):
        t.penup()
        t.goto((-300), 300)
        t.write("二举", align="right", font=("楷体", 16, "bold"))
        cp5 += 1
        cp8 += 100*cp9
    elif (s1 == 1):
        if (a == 1 and e == 1 and s == 1 and w == 1 and l == 1):
            t.penup()
            t.goto((-300), 300)
            t.write("对堂", align="right", font=("楷体", 16, "bold"))
            cp2 += 1
            cp8 += 400*cp9
        else:
            t.penup()
            t.goto((-300), 300)
            t.write("一秀", align="right", font=("楷体", 16, "bold"))
            cp6 += 1
            cp8 += 50*cp9
    else:
        t.penup()
        t.goto((-300), 300)
        t.write("什么都没有", align="right", font=("楷体", 16, "bold"))
        cp7 += 1
        cp8 -= 100*cp9
    print(h)
    time.sleep(2)
    # 清理画布
    t.clear()
    t.penup()
    t.goto((-100), 0)
    t.write("什么都没有:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), 0)
    t.write(cp7, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-40))
    t.write("状元:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-40))
    t.write(cp1, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-20))
    t.write("状元插金花:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-20))
    t.write(cp, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-60))
    t.write("对堂:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-60))
    t.write(cp2, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-80))
    t.write("四进:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-80))
    t.write(cp3, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-100))
    t.write("三红:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-100))
    t.write(cp4, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-120))
    t.write("二举:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-120))
    t.write(cp5, align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-100), (-140))
    t.write("一秀:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-90), (-140))
    t.write(cp6, align="right", font=("楷体", 16, "bold"))
    # c = int(turtle.textinput('对话框', '是请按1'))
    t.penup()
    t.goto((-100), (-160))
    if(cp8<=0):
        cp8=0
    t.write("钱数:", align="right", font=("楷体", 16, "bold"))
    t.penup()
    t.goto((-70), (-160))
    t.write(cp8, align="right", font=("楷体", 16, "bold"))
    time.sleep(2)
    # 清理画布
    t.clear()
    if(easygui.ynbox('是否继续?', 'Codemao', ('是', '否'))==False):
        break
    t.penup()
t.goto((-100), (-160))
t.write("您还有", align="right", font=("楷体", 16, "bold"))
t.penup()
t.goto((-70), (-160))
t.write(cp8, align="right", font=("楷体", 16, "bold"))
t.penup()
t.goto((-40), (-160))
t.write('元', align="right", font=("楷体", 16, "bold"))


http://www.kler.cn/news/363891.html

相关文章:

  • sqli-labs靶场安装以及刷题记录-docker
  • 【C++】——list 容器的解析与极致实现
  • 物联网消息队列Emqx日志配置及日志追踪以及Centos7上的rc.local开机不执行、git提交的小问题
  • 程序员:数字时代的先锋
  • 光储充微电网:策略调度带领能源新未来---安科瑞 吴雅芳
  • 在MySQL中建索引时需要注意哪些事项?
  • WPF MVVM模式实现DataGrid编辑
  • vue2.x 的依赖收集通知更新
  • 【力扣 | SQL题 | 每日4题】力扣1164,3293,1308,1270
  • 【scene_manager_msgs】ROS2 自定义消息、服务的包
  • 动态规划:17.简单多状态 dp 问题_买卖股票的最佳时机III_C++
  • OpenCV高级图形用户界面(17)设置一个已经创建的滚动条的最小值函数setTrackbarMin()的使用
  • 七、高级查询和数据操作及数据完整性和约束
  • 基于Linux来讲解Kconfig的基础知识
  • 【2024版】sql-liabs靶场前十关解题过程和思路----适合入门小白
  • Appium环境搭建全流程(含软件)
  • Java项目-基于springboot框架的社区疫情防控平台系统项目实战(附源码+文档)
  • React 纯手写一个 Modal 组件,除了样式不太美观以外,其他功能都不错呢?附上全部源码
  • vscode ssh连接远程服务器一直卡在正在打开远程
  • linux,socket编程,select,poll,epoll学习
  • MATLAB基础应用精讲-【数模应用】负二项回归(附R语言和python代码实现)
  • OpenCV高级图形用户界面(16)设置一个已经创建的滚动条的最大值函数setTrackbarMax()的使用
  • 【跑酷项目02】实现触发并在前方克隆金币
  • 编辑器加载与AB包加载组合
  • SQL注入原理、类型、危害与防御
  • 使用cmdline-tools安装Android SDK与NDK