python

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

import turtle

def newgoto(x, y):
    turtle.up()
    turtle.goto(x, y)
    turtle.down()

def draw(x):
    turtle.begin_fill()
    for i in  range(5):
        turtle.forward(x)
        turtle.right(144)
    turtle.end_fill()


turtle.setup(600, 400, 0, 0)
turtle.color("yellow")
turtle.bgcolor("red")
turtle.fillcolor("yellow")

newgoto(-250, 75)

draw(100)

for i in range(4):
    n=1
    if i in [0,3]:
        n=0
    newgoto(-100+n*50, 150-i*60)
    turtle.left(15-i*30)
    n=n+1
    draw(50)

turtle.hide()
turtle.done()

 

posted on 2018-03-19 10:05  370蔡轩  阅读(181)  评论(0编辑  收藏  举报