猫史档案馆


逸南向北

逸南向北

Lv.1

获赞:1收藏:1浏览:0作品收藏:0
回复帖子评论
上一页1 页 / 共 1下一页

你有什么烦心事吗? 中回复

可以帮我改一下这串代码的问题吗?

import turtle
import random
p1 = turtle.Pen()
p2 = turtle.Pen()
p3 = turtle.Pen()
p1.penup()
p2.penup()
p3.penup()
p1.ht()
p2.ht()
p3.ht()
turtle.addshape('codemao-biu.gif')
turtle.addshape('virus.gif')
turtle.addshape('iceball.gif')
turtle.addshape('fireball.gif')
p1.shape('codemao-biu.gif')
p2.shape('virus.gif')
p3.shape('fireball.gif')
p1.forward(-100)
p2.forward(300)
p3.forward(-100)
p3.ht()
n=50
p1.st()
p2.st()
idx = random.randint(1,2)
items = ['fireball.gif','iceball.gif']
for i in random (3):
p3.shape('fireball.gif')
p1.forward(-100)
p1.forward(100)
p3.st()
p3.forward(400)
p3.dot(n,'white')
p3.ht()
p3.forward(-400)
n = n + 100
turtle.done()

2024-01-20T23:19:36 点赞:0