博饼代码【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"))