五星红旗

# -*- coding: UTF-8 -*-

from turtle import *
def mygoto(x,y):
    up()
    goto(x,y)
    down()
 
 
''' def draw(z):
    while True:
        forward(z)
        left(144)
        if abs(pos()) < 1:
            break
    end_fill()
'''
 
def draw(z):
    begin_fill()
    for in range(5):
        forward(z)
        right(144)
    end_fill()
 
setup(700,500,0,0)
color("yellow")
bgcolor("red")
fillcolor("yellow")
hideturtle()
 
mygoto(-225,75)
draw(100)
 
mygoto(-130,150)
draw(30)
 
mygoto(-80,100)
draw(30)
 
mygoto(-80,40)
draw(30)
 
mygoto(-125,-10)
draw(30)
 
done()<br><br>

 

posted @ 2018-03-22 21:55  201505060365张木贵  阅读(102)  评论(0编辑  收藏  举报