Commit 34028dc9 by BellCodeEditor

save project

parent cab3a055
Showing with 22 additions and 11 deletions
......@@ -2,18 +2,28 @@
请使用turtle模块画出五角星
"""
import turtle as t
import random as r
t.speed(0)
t.shape("arrow")
t.fillcolor("red")
t.tracer(False)
t.begin_fill()
for j in range(1,4):
for i in range(72):
for i in range(5):
t.forward(100*j)
t.right(144)
t.right(5)
t.end_fill()
t.update()
co=["blue","yellow","red","light green"]
while True:
t.tracer(False)
t.fillcolor(co[r.randint(0,3)])
a=r.randint(-720,720)
b=r.randint(-300,300)
t.penup()
t.goto(a,b)
t.pendown()
t.begin_fill()
x=r.randint(100,200)
for i in range(36):
t.forward(x)
t.right(170)
t.end_fill()
t.update()
t.hideturtle()
t.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment