用Python代码制作一种回忆,叫做海绵宝宝,给所有小朋友送上特殊的儿童节祝福!

Captain: Are ya ready kids?

船长:准备好了吗,孩子们?

Kids: Aye Aye Captain.

孩子:是的,船长。

Captain: I can’t hear you.

船长:太小声咯。

Kids: Aye Aye Captain!

孩子:是的!船长!

Captain: OHHH, Who lives in a pineapple under the sea?

船长:哦哦哦~~~,是谁住在深海的大凤梨里?

Kids: SpongeBob SquarePants!

孩子:海绵宝宝!

一听到这熟悉的主题曲,就知道海绵宝宝要来了。

《海绵宝宝》是美国电视节目历史上最受孩子们喜爱的动画系列片之一,当这个可爱的海绵方块形象在1999年一推出,就受到小朋友乃至成人观众的疯狂喜爱。

如果你心存童真

无论你多大

六一儿童节都是你的✨

每天迎接你的

都是海绵宝宝大大的微笑

锁住满满开心🥳

明天是六一儿童节

让我们用Python制作一个海绵宝宝

送给自己

愿我们能像海绵宝宝一样

无论遇见什么困难

都可以微笑面对

**

代码实现

**

from turtle import \*  
  
def go\_to(x, y):  
    penup()  
    goto(x, y)  
    pendown()  
  
def help\_do():  
    go\_to(-400, 0)  
    forward(800)  
    go\_to(-400, 100)  
    forward(800)  
    go\_to(-400,200)  
    forward(800)  
    go\_to(-400, -100)  
    forward(800)  
    go\_to(-400, -200)  
    forward(800)  
    left(90)  
    go\_to(0,-300)  
    forward(600)  
    go\_to(100, -300)  
    forward(600)  
    go\_to(-100, -300)  
    forward(600)  
    go\_to(-200, -300)  
    forward(600)  
    go\_to(200, -300)  
    forward(600)  
  
def head():  
    go\_to(-200, 180)  
    fillcolor('yellow')  
    begin\_fill()  
    seth(-30)  
    for \_ in range(6):  
        circle(36, 60)  
        circle(-36, 60)  
    seth(-125)  
    for \_ in range(5):  
        circle(40,60)  
        circle(-40,60)  
    seth(-210)  
    for \_ in range(4):  
        circle(45,60)  
        circle(-45,60)  
    seth(65)  
    for \_ in range(5):  
        circle(40,60)  
        circle(-40,60)  
    end\_fill()  
  
def eye():  
    \# 眼白  
    go\_to(14, -5)  
    fillcolor('#f0f0f0')  
    begin\_fill()  
    circle(65, 360)  
    end\_fill()  
    begin\_fill()  
    go\_to(13,12)  
    seth(98)  
    circle(-65,360)  
    end\_fill()  
  
    #眼球  
    go\_to(-10,20)  
    fillcolor('blue')  
    begin\_fill()  
    circle(20,360)  
    end\_fill()  
    go\_to(-22,20)  
    fillcolor('black')  
    begin\_fill()  
    circle(7,360)  
    end\_fill()  
    go\_to(40,15)  
    fillcolor('blue')  
    begin\_fill()  
    circle(-20, 360)  
    end\_fill()  
    go\_to(53,15)  
    fillcolor('black')  
    begin\_fill()  
    circle(-7,360)  
    end\_fill()  
  
    #睫毛  
    go\_to(-95,65)  
    left(20)  
    forward(40)  
    go\_to(-50,87)  
    right(25)  
    forward(32)  
    go\_to(0,70)  
    right(25)  
    forward(40)  
  
    go\_to(40, 75)  
    left(35)  
    forward(40)  
    go\_to(90, 87)  
    right(18)  
    forward(30)  
    go\_to(120, 70)  
    right(25)  
    forward(40)  
  
def nose():  
    fillcolor('yellow')  
    go\_to(0, -7)  
    begin\_fill()  
    right(50)  
    circle(-60, 30)  
    color('yellow')  
    goto(15,-40)  
    end\_fill()  
    color('black')  
    go\_to(0, -7)  
    seth(-75)  
    forward(30)  
    go\_to(30,-7)  
    seth(-105)  
    forward(30)  
  
def mouth():  
    go\_to(-120, - 60)  
    seth(-45)  
    circle(200, 30)  
    seth(0)  
    forward(100)  
    seth(15)  
    circle(200, 30)  
  
def tooth():  
    go\_to(-30,-114)  
    seth(-95)  
    fillcolor('white')  
    begin\_fill()  
    forward(30)  
    seth(0)  
    forward(40)  
    seth(95)  
    forward(30)  
    go\_to(-30,-114)  
    end\_fill()  
  
    go\_to(30, -114)  
    seth(-95)  
    fillcolor('white')  
    begin\_fill()  
    forward(30)  
    seth(0)  
    forward(40)  
    seth(95)  
    forward(30)  
    go\_to(60, -114)  
    end\_fill()
  
def face():  
    eye()  
    nose()  
    mouth()  
    tooth()  
  
def body():  
    go\_to(-170,-180)  
    seth(-120)  
    circle(150, 30)  
    seth(0)  
    forward(40)  
    seth(100)  
    forward(35)  
    seth(-80)  
    forward(100)  
    fillcolor('brown')  
    begin\_fill()  
    seth(0)  
    forward(300)  
    seth(80)  
    forward(110)  
    seth(-100)  
    forward(65)  
    seth(180)  
    forward(315)  
    go\_to(-118,-400)  
    end\_fill()  
    go\_to(-170,-255)  
    fillcolor('yellow')  
    begin\_fill()  
    seth(-75)  
    forward(80)  
    seth(0)  
    forward(17)  
    seth(105)  
    forward(85)  
    end\_fill()  
  
    go\_to(200, -170)  
    seth(-60)  
    circle(-150,30)  
    seth(-180)  
    forward(45)  
    begin\_fill()  
    seth(0)  
    forward(20)  
    seth(-100)  
    forward(85)  
    seth(180)  
    forward(20)  
    end\_fill()  
  
def tie():  
    go\_to(-50,-225)  
    seth(-40)  
    forward(40)  
    seth(30)  
    forward(52)  
    go\_to(30,-225)  
    seth(-30)  
    forward(40)  
    seth(40)  
    forward(45)  
    fillcolor('red')  
    go\_to(0, -240)  
    begin\_fill()  
    seth(-60)  
    forward(10)  
    seth(0)  
    forward(30)  
    seth(60)  
    forward(15)  
    go\_to(30,-225)  
    end\_fill()  
    go\_to(4,-250)  
    begin\_fill()  
    seth(-100)  
    forward(80)  
    seth(0)  
    forward(55)  
    seth(100)  
    forward(80)  
    end\_fill()  
  
def spongeBob():    \# help\_do()  
    head()  
    face()  
    body()  
    tie()  
  
if \_\_name\_\_=='\_\_main\_\_':  
    screensize(800, 600, 'white')  
    pensize(3)  
    speed(10)  
    go\_to(0, 0)  
    spongeBob()  
    go\_to(-100,240)  
    write('六一儿童节快乐!',font\=('BRUSHSCI.TTF', '30', 'bold'))  
    mainloop()

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值