![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
zizhan
少儿编程侯老师
这个作者很懒,什么都没留下…
展开
-
zizhan - 猜数字游戏
import random as rimport turtle as tbig = 1000small = 1a = r.randint(small, big)for c in range(20): try: b = int(t.textinput('猜数字小游戏', '请猜一个%s~%s之间的数字' % (small, big))) # t.undo() t.dot(10000, 'white') if a == b:原创 2020-08-24 13:47:35 · 147 阅读 · 0 评论 -
zizhan -高级彩虹
import turtle as twidth = 1t.speed(0)t.width(width+4)t.left(90)t.colormode(255)r=250# 红色:255 0 0# 橙色:255 165 0suoxiao = 10print(255*suoxiao-suoxiao*2)for a in range(0,255*2,suoxiao): print(a) if a >= 255: r -= suoxiao原创 2020-08-19 13:45:36 · 138 阅读 · 0 评论 -
zizhan - 调色盘
import turtle as tt.speed(0)a=1000color=1color2=0color3=0t.width(10)t.lt(90)t.fd(100)flag1 = Trueflag2 = Falsewhile a>=0: t.color((color3,color2,color)) t.dot(a) a-=1000/400 if flag1: if color > 0.1: col原创 2020-08-14 13:44:33 · 147 阅读 · 0 评论 -
zizhan -猜拳游戏4.0
import randomwin=0lose=0ping=0ju=0# 我们出拳aa = input('''请出拳任意次数石头是1,布是2,剪刀是3''')try: while ju<len(aa): ju = ju + 1 print('第', ju, '局') a=int(aa[ju-1]) b = random.randint(1, 3) # 判断胜负 if a==1 or原创 2020-08-12 13:25:07 · 221 阅读 · 0 评论 -
zizhan -剪刀石头布3.0
import randomwin=0lose=0ping=0ju=0ju=ju+1print('第',ju,'局')# 我们出拳aa = input('''请出拳五次石头是1,布是2,剪刀是3''')try: a=int(aa[ju-1]) b = random.randint(1, 3) # 判断胜负 if a==1 or a==2 or a==3: result = a - b if result == -2 or.原创 2020-08-12 13:04:38 · 117 阅读 · 0 评论 -
zizhan -猜拳2.5
import randomju=0ju=ju+1print('第',ju,'局')# 我们出拳aa = input('''请出拳五次石头是1,布是2,剪刀是3''')try: a=int(aa[ju-1]) b = random.randint(1, 3) # 判断胜负 if a==1 or a==2 or a==3: result = a - b if result == -2 or result == 1:原创 2020-08-10 13:41:26 · 118 阅读 · 0 评论 -
zizhan - 猜拳小游戏
"""石头1 布2 剪刀3赢我们 电脑 结果1 3 -22 1 13 2 1"""import random# 我们出拳a = int(input('''请出拳石头是1,布是2,剪刀是3'''))# 电脑出拳b = random.randint(1, 3)# 判断胜负if a==1 or a==2 or a==3: result = a - b if result == -2 or resu原创 2020-08-07 13:32:51 · 161 阅读 · 0 评论 -
zizhan- 滑稽/笑脸表情包
import turtle as tt.width(5)t.speed(0)#脸# 三原色:红 黄 蓝 颜料# 三基色:红 绿 蓝 光t.colormode(1)t.color(161/255,122/255,44/255)# 写数字0-1t.fillcolor(1,1,0)t.begin_fill()t.circle(150)t.end_fill()# moutht.up()t.goto(0, 130)t.down()t.dot(220,"black")t.up原创 2020-08-05 13:50:39 · 419 阅读 · 0 评论 -
zizhan -判断
# 炉石传说血量 = int(input('你还有多少血'))if 血量 <= 0: print('失败')else: difang = int(input('敌方还有多少血')) if difang <= 0: print('胜利') else: print('哇哦')import turtle as tkaiguan = t.textinput('子瞻牌灯泡', '开不开灯')t.width(20)t.colo原创 2020-07-27 13:50:28 · 179 阅读 · 0 评论 -
zizhan - 字符串计算器
a = '2'b = 5print(a+str(b))print(int(a)+b)# 数字 + 数字 数学运算# 字符串 + 字符串 连接在一起# a = int(input('请输入第一个数字'))# b = int(input('请输入第二个数字'))# print(int(a)+int(b))# print(a-b)import turtle as ta = t.textinput('计算器', '请输入一个计算式')result = eval(a)t.write原创 2020-07-24 13:47:52 · 228 阅读 · 0 评论 -
zizhan - 深海巨兽
# encoding:UTF-8import turtle as t# 1.天空t.bgcolor('skyblue')t.speed(0)# 2.大海t.color('blue')t.fillcolor('blue')t.begin_fill()t.fd(360)t.rt(90)t.fd(360)t.rt(90)t.fd(360)t.fd(360)t.rt(90)t.fd(360)t.rt(90)t.fd(360)t.end_fill()# 3,月亮t.up()原创 2020-07-20 13:41:11 · 191 阅读 · 0 评论 -
zizhan - 变量 彩虹
import turtle as tt.shape("turtle")t.width(20)t.left(90)t.color('red')t.circle(200,180)t.lt(90)t.up()t.fd(20)t.down()t.lt(90)t.color('orange')t.circle(-180,180)t.rt(90)t.up()t.fd(20)t.down()t.rt(90)t.color('yellow')t.circle(160,180)t.do原创 2020-07-17 13:43:24 · 171 阅读 · 0 评论 -
zizhan - 瞄准镜
import turtle as tt.shape("turtle")t.width(10)# circle(半径,角度)t.circle(100,360)t.width(4)t.goto(0,220)t.right(90)t.fd(240)t.up()t.goto(-120,100)t.down()t.left(90)t.fd(240)t.up()t.goto(0,50)t.down()t.circle(50,22.5)t.up()t.circle(50,45)t.原创 2020-07-13 13:45:19 · 186 阅读 · 0 评论