猫史档案馆


【Python作品分享】大黄鸡

用户:小鱼队长小鱼队长查看:0 回复:0 评论:0 创建时间:2021-04-08T12:02:45


【Python作品分享】大黄鸡    0     0   变形金刚擎天柱prime100

玄武工作室

刚刚发布

【作品展示】

 

【Python作品分享】大黄鸡 变形金刚擎天柱prime100

刚刚发布

【作品展示】

center_image

 

【作品介绍】

o

I=

/\

 

【作品源代码】

import turtle


t = turtle.Pen()
t.speed(0)

def head():

    t.penup()
    t.goto(0, (-100))
    t.pendown()
    t.begin_fill()
    t.fillcolor('gold')
    t.circle(100)
    t.end_fill()
    t.penup()

def glasses():

    # 左镜框
    t.penup()
    t.goto(20, 50)
    t.pencolor('brown')
    t.pensize(10)
    t.setheading(0)
    t.pendown()
    t.fillcolor('skyblue')
    t.begin_fill()
    t.forward(60)
    t.circle(8, 90)
    t.forward(30)
    t.circle(8, 90)
    t.forward(60)
    t.circle(8, 90)
    t.forward(30)
    t.circle(8, 90)
    t.end_fill()
    # 右镜框
    t.penup()
    t.goto((-20), 50)
    t.setheading(180)
    t.pendown()
    t.begin_fill()
    t.forward(60)
    t.circle((-8), 90)
    t.forward(30)
    t.circle((-8), 90)
    t.forward(60)
    t.circle((-8), 90)
    t.forward(30)
    t.circle((-8), 90)
    t.end_fill()
    # 眼镜连接
    t.penup()
    t.goto((-6), 70)
    t.setheading(0)
    t.pensize(20)
    t.pendown()
    t.forward(13)
    # 左镜片光泽
    t.penup()
    t.goto(50, 65)
    t.setheading(45)
    t.pensize(8)
    t.pencolor('white')
    t.pendown()
    t.forward(25)
    t.penup()
    t.goto(70, 65)
    t.pendown()
    t.forward(12)
    # 右镜片光泽
    t.penup()
    t.goto((-50), 65)
    t.setheading(45)
    t.pensize(8)
    t.pencolor('white')
    t.pendown()
    t.forward(25)
    t.penup()
    t.goto((-30), 65)
    t.pendown()
    t.forward(12)

def face():

    # 右眼睛
    t.pencolor('black')
    t.pensize(5)
    t.penup()
    t.goto(55, 15)
    t.pendown()
    t.setheading(110)
    t.circle(20, 140)
    t.penup()
    # 左眼睛
    t.goto((-55), 15)
    t.pendown()
    t.setheading(70)
    t.circle((-20), 140)
    t.penup()
    # 嘴巴(外)
    t.goto((-15), (-10))
    t.pensize(1)
    t.pencolor('coral')
    t.fillcolor('coral')
    t.setheading((-90))
    t.pendown()
    t.begin_fill()
    t.circle(15, 180)
    for i in range(10):
        t.forward(3)
        t.left(7)
    t.left(20)
    t.backward(2)
    t.left(20)
    for i in range(10):
        t.forward(3)
        t.left(7)
    t.end_fill()
    # 嘴巴(里)
    t.penup()
    t.goto(12, (-10))
    t.setheading(120)
    t.pencolor('darkred')
    t.fillcolor('darkred')
    t.begin_fill()
    t.circle(14, 120)
    t.setheading((-60))
    t.circle(14, 120)
    t.end_fill()

def hands():

    # 左手
    t.penup()
    t.goto(100, 0)
    t.pensize(1)
    t.pencolor('black')
    t.setheading((-10))
    t.pendown()
    t.fillcolor('gold')
    t.begin_fill()
    for i in range(7):
        t.forward(9)
        t.right(6)
    for i in range(19):
        t.forward(1)
        t.right(6)
    for i in range(7):
        t.forward(9)
        t.right(5)
    t.end_fill()
    # 右手
    t.penup()
    t.goto((-100), 0)
    t.setheading(190)
    t.pendown()
    t.fillcolor('gold')
    t.begin_fill()
    for i in range(7):
        t.forward(9)
        t.left(6)
    for i in range(19):
        t.forward(1)
        t.left(6)
    for i in range(7):
        t.forward(9)
        t.left(5)
    t.end_fill()

def hat():

    # 蓝色部分
    t.penup()
    t.goto(50, 96)
    t.pencolor('deepskyblue')
    t.fillcolor('deepskyblue')
    t.pensize(1)
    t.pendown()
    t.begin_fill()
    t.setheading(90)
    t.circle(10, 90)
    t.forward(10)
    t.setheading(90)
    t.forward(10)
    t.circle(5, 90)
    t.forward(50)
    t.circle(5, 90)
    t.forward(10)
    t.setheading(180)
    t.forward(10)
    t.circle(10, 90)
    t.setheading(0)
    t.forward(100)
    t.end_fill()
    # 棕色部分
    t.penup()
    t.goto(20, 122)
    t.pencolor('brown')
    t.fillcolor('brown')
    t.setheading(90)
    t.pendown()
    t.begin_fill()
    t.forward(15)
    t.circle(5, 90)
    t.forward(30)
    t.circle(5, 90)
    t.forward(15)
    t.end_fill()

def draw():

    head()
    face()
    hat()
    glasses()
    hands()
    turtle.done()

#开始进入Python的世界
draw()

 

                                                 

 

                          编程猫社区守则> 发表回帖   举报此作品 <select class="r-community-r-detail-c-report_posts--reason_select"> <option value="1">违法违规</option> <option value="2">喵喵</option> <option value="3">喵</option> <option value="4">人身攻击</option> <option value="5">引战</option> <option value="6">垃圾广告</option> <option value="7">无意义刷屏</option> <option value="8">不良信息</option> </select><textarea class="r-community-r-detail-c-report_posts--editor" placeholder="请补充具体举报线索"></textarea> 举报   请选择举报理由   <textarea class="r-community-r-detail-c-report_comment--editor" maxlength="100" placeholder="请填写举报理由(1-100字)"></textarea> 举报

关于我们

 

其他服务

更多工具

电脑设备检测

服务协议

用户协议

隐私协议

免责声明

       

欢迎使用可信网站验证

粤I喵备 15030912号 粤公网安备 44030602003657号

深圳点猫科技有限公司   © 2021 Shenzhen Dianmao Technology Limited. All right reserved


回复

上一页1 页 / 共 0下一页