作业_大猩猩(误)

0

from turtle import Turtle,Screen
from random import randint,choice
t=Turtle()
t.speed(0)
s=Screen()
s.delay(0)
cs=['blue','red'
    ,'green','yellow','orange','cyan','purple','pink']
def 马NB (t,l,s):
    t.begin_fill()
    for x in range(5):
        t.fd(l)
        t.rt(144)
    t.end_fill()
w=s.window_width()
h=s.window_height()
while True:
    c=randint(-w//2,w//2)
    v=randint(-h//2,h//2)
    b=randint(10,100)
    t.penup()
    t.goto(c,v)
    t.color(choice(cs))
    s.bgcolor(choice(cs))
    t.pendown()
    马NB(t,b,s)
0

发表评论