用户:
弧光紫禁查看:0 回复:0 评论:0 创建时间:2021-01-02T16:31:40
【作品展示】

【作品介绍】
天黑路滑,社会复杂~~
【作品源代码】
import easygui
import turtle
import time
import random
__Pen = turtle.Pen()
# 加减乘除小能手
if easygui.ynbox('“加减乘除小能手”想访问您的计算机,是否同意?', '提示', ('是', '否')):
平均分 = 0
总分 = 0
easygui.msgbox('你好,我是新夜,你的好朋友!接下来,让我们一起闯荡这个计算世界吧!', '初来驾到', '你好,新夜!')
__Pen.goto(0, 0)
turtle.bgcolor("#ffffff")
__Pen.pencolor("#3333ff")
__Pen.write('新夜中间联合团 出品', font = ('', 15, 'italic'))
__Pen.goto(0, (-10))
__Pen.write('按右上角小×关闭', font = ('Arial', 10, 'bold'))
turtle.done()
time.sleep(1)
答对个数 = 0
guess = input('请输入你的昵称')
print('你好呀!', guess, '我是新夜', '')
time.sleep(1)
print('时间:', time.ctime())
time.sleep(1)
print('你想进行加法(写1)、减法(写2)、乘法(写3)、除法(写4)、小数点加法(写5)还是乘法计算竞赛(写1002)')
guess = input('请选择')
temp = int(guess)
if (temp == 1):
print('欢迎来到加法世界!')
time.sleep(1)
print('下面,我会随机问你20题哦!')
time.sleep(1)
for __count in range(20):
a = random.randint(1, 100)
b = random.randint(1, 100)
print(a, '+', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a + b):
print('你答对了!')
答对个数 += 1
time.sleep(1)
else:
print('对不起,你答错了......')
time.sleep(1)
print('你答对了:', 答对个数, '题!')
if (temp == 2):
print('欢迎来到减法世界!')
time.sleep(1)
print('下面,我会随机问你20题哦!')
time.sleep(1)
for __count in range(20):
a = random.randint(1, 100)
b = random.randint(1, 100)
print(a, '-', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a - b):
print('你答对了!')
答对个数 += 1
time.sleep(1)
else:
print('对不起,你答错了......')
time.sleep(1)
print('你答对了:', 答对个数, '题!')
if (temp == 3):
print('欢迎来到乘法世界!')
time.sleep(1)
print('下面,我会随机问你20题哦!')
time.sleep(1)
for __count in range(20):
a = random.randint(1, 100)
b = random.randint(1, 100)
print(a, '×', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a * b):
print('你答对了!')
答对个数 += 1
time.sleep(1)
else:
print('对不起,你答错了......')
time.sleep(1)
print('你答对了:', 答对个数, '题!')
if (temp == 4):
print('欢迎来到除法世界!')
time.sleep(1)
print('下面,我会随机问你20题哦!')
time.sleep(1)
for __count in range(20):
a = random.randint(1, 100)
b = random.randint(1, 100)
print(a, '÷', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a / b):
print('你答对了!')
答对个数 += 1
time.sleep(1)
else:
print('对不起,你答错了......')
time.sleep(1)
if (temp == 5):
print('欢迎来到小数点加法世界!')
time.sleep(1)
print('下面,我会随机问你5题哦!')
time.sleep(1)
for __count in range(5):
a, b = random.uniform(0, 50), random.uniform(0, 50)
print(a, '+', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a + b):
print('你答对了!')
答对个数 += 1
time.sleep(1)
else:
print('对不起,你答错了......')
time.sleep(1)
print('你答对了:', 答对个数, '题!')
if (temp == 1002):
print('您即将进入考试阶段!')
time.sleep(1)
print('共有25道口算题,10道笔算题,共计总分200分,平均分100分。')
time.sleep(1)
easygui.msgbox('点击下方按钮即可开始答题! 系统已加载完毕。', '温馨提示', '开始答题')
for __count in range(25):
a, b = random.randint(1, 100), random.randint(0, 10)
print(a, '×', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a * b):
print('你答对了!')
总分 += 4
time.sleep(0.5)
else:
print('对不起,你答错了......')
time.sleep(0.5)
for __count in range(10):
a, b = random.randint(1, 1000), random.randint(1, 1000)
print(a, '×', b, '=?')
guess = input('请回答')
temp = int(guess)
if (temp == a * b):
print('你答对了!')
总分 += 10
time.sleep(0.5)
else:
print('对不起,你答错了......')
time.sleep(0.5)
平均分 = (总分 + 2)
easygui.msgbox('恭喜您!答完了所有题目!', '考试完毕', '知道了')
print('您的总分是', 总分, '分。')
print('您的平均分是', 平均分, '分。')
easygui.msgbox('系统即将清除缓存 0/5000', '提示', '好的')
for i in range(1, 5001, 1):
print('已清理:', i, '/5000')
time.sleep(1e-173)
easygui.msgbox('清理完成! 5000/5000', '提示', '好的')
else:
easygui.msgbox('游戏加载异常!', '提示', '知道了')
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn