猫史档案馆


【Python作品分享】大圆吃小圆

用户:陈璞2012陈璞2012查看:0 回复:0 评论:0 创建时间:2022-06-05T17:17:02


【作品展示】

center_image

 

【作品介绍】

 

【作品源代码】

import turtle
import random
p = turtle.Pen()
p1 = turtle.Pen()
p.penup()
p.ht()
p1.speed(1)
p.speed(99999)
p1.penup()
p1.shape('circle')
x = random.randint(-400, 400)
y = random.randint(-400, 400)
def tcs():
    p.goto(x,y)
    p.dot(10,'red')

def tcs1():
    p1.goto(x,y)
    p.clear()

while True:
    x = random.randint(-450, 450)
    y = random.randint(-450, 450)
    tcs()
    tcs1()

turtle.done

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页