五星红旗

import turtle
turtle.setup(600, 400)
turtle.speed(10)
turtle.penup()
turtle.goto(-300, 200)
turtle.pendown()
turtle.color("red")
turtle.begin_fill()
for _ in range(2):
    turtle.forward(600)
    turtle.right(90)
    turtle.forward(400)
    turtle.right(90)
turtle.end_fill()
def draw_star(x, y, radius):
    turtle.penup()
    turtle.goto(x, y)
    turtle.setheading(0)
    turtle.pendown()
    turtle.color("yellow")
    turtle.begin_fill()
    for _ in range(5):
        turtle.forward(radius)
        turtle.right(144)
    turtle.end_fill()
draw_star(-200, 100, 100)
small_stars = [(-100, 160), (-60, 120), (-60, 60), (-100, 20)]
for star in small_stars:
    draw_star(star[0], star[1], 30)
turtle.hideturtle()
turtle.done()
posted @ 2025-02-25 09:32  无聊了多少人  阅读(4)  评论(0)    收藏  举报