admin 管理员组文章数量: 887016
2024年1月10日发(作者:dialog半导体股价)
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 hole():go_to(-160,160)# fillcolor('#ffd700')# begin_fill()circle(30, 360)# a=1# for i in range(120):# if 0<=i<30 or 60<=i<90:# a=a+0.2# lt(3)# forward(a)# else:# a=a-0.2# lt(3)# forward(a)# end_fill()def face():eye()nose()mouth()
tooth()# hole()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=('', '30', 'bold'))mainloop()
版权声明:本文标题:源代码_Python使用turtle绘制海绵宝宝源代码,画,源码 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.freenas.com.cn/jishu/1704821318h463201.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论