Commit 34028dc9 by BellCodeEditor

save project

parent cab3a055
Showing with 22 additions and 11 deletions
...@@ -2,18 +2,28 @@ ...@@ -2,18 +2,28 @@
请使用turtle模块画出五角星 请使用turtle模块画出五角星
""" """
import turtle as t import turtle as t
import random as r
t.speed(0) t.speed(0)
t.shape("arrow") t.shape("arrow")
t.fillcolor("red")
t.tracer(False)
t.begin_fill()
for j in range(1,4): co=["blue","yellow","red","light green"]
for i in range(72): while True:
for i in range(5): t.tracer(False)
t.forward(100*j) t.fillcolor(co[r.randint(0,3)])
t.right(144) a=r.randint(-720,720)
t.right(5) b=r.randint(-300,300)
t.end_fill() t.penup()
t.update() 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.hideturtle()
t.done() 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