猫史档案馆


【Python作品分享】冰墩墩【作品秀】

用户:ξ纸伞挽佳人❦ξ纸伞挽佳人❦查看:0 回复:1 评论:0 创建时间:2022-02-09T13:22:12


【作品展示】

center_image

 

【作品介绍】

冰墩墩

 

【作品源代码】

import turtle as t
# t.screensize(1500,1500,'white')
t.speed(0)
t.pensize(5)
t.color('black')
t.hideturtle()
t.delay(0)
#ear right
t.penup()
t.goto(42.25, 100.5)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.setheading(75)
t.circle(-15, 100)
t.circle(-30, 86)
t.end_fill()
#ear right
t.penup()
t.goto(-42.25, 100.5)
t.pendown()
t.begin_fill()
t.setheading(105)
t.circle(15, 100)
t.circle(30, 86)
t.end_fill()
#body shape right
t.penup()
t.goto(0, 110)
t.setheading(0)
t.pendown()
t.circle(-100, 85)
t.circle(-195, 35)
t.right(5)
t.circle(-12.5, 30)
t.circle(-150, 30)
#body shape left
t.penup()
t.goto(0, 110)
t.pendown()
t.setheading(180)
t.circle(100, 85)
t.circle(195, 35)
t.left(5)
t.circle(12.5, 30)
t.circle(150, 30)
#right hand
t.pensize(2.5)
t.penup()
t.goto(100, -5)
t.pendown()
t.setheading(60)
t.fillcolor('black')
t.begin_fill()
t.forward(20)
t.circle(-15, 140)
t.circle(-27.5, 30)
t.circle(-32.5, 78)
t.end_fill()
#little red heart
t.pensize(1)
t.color('red')
t.fillcolor('red')
t.penup()
t.goto(122.5, 7.5)
t.pendown()
t.setheading(120)
t.begin_fill()
t.forward(3.5)
t.circle(2.5, 160)
t.right(10)
t.circle(7.5, 60)
t.forward(3.6)
t.setheading(35)
t.forward(5)
t.circle(7.5, 40)
t.circle(2.5, 180)
t.right(30)
t.forward(3.5)
t.end_fill()
#left hand
t.color('black')
t.fillcolor('black')
t.pensize(2.5)
t.penup()
t.goto(-101, -22.5)
t.begin_fill()
t.setheading(-125)
t.pendown()
t.forward(35)
t.circle(15, 160)
t.circle(12.5, 40)
t.circle(25, 25)
t.end_fill()
#right foot
t.fillcolor('black')
t.penup()
t.goto(32.5, -112.5)
t.begin_fill()
t.setheading(-90)
t.pendown()
t.forward(15)
t.circle(-20, 32)
t.circle(3.5, 110)
t.circle(30, 10)
t.circle(50, 5)
t.forward(24)
t.circle(7.5, 90)
t.forward(39)
t.setheading(-158)
t.forward(40)
t.end_fill()
#left foot
t.fillcolor('black')
t.penup()
t.goto(-32.5, -112.5)
t.begin_fill()
t.setheading(-90)
t.pendown()
t.forward(15)
t.circle(20, 32)
t.circle(-3.5, 110)
t.circle(-30, 10)
t.circle(-50, 5)
t.forward(24)
t.circle(-7.5, 90)
t.forward(39)
t.setheading(-22)
t.forward(40)
t.end_fill()
#circles
#blue right
t.color('#喵95ED')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 70)
t.pendown()
t.circle(-105, 15)
t.circle(-80, 20)
t.circle(-60, 80)
t.circle(-15, 40)
t.circle(-140, 30)
#blue left
t.penup()
t.setheading(180)
t.goto(0, 70)
t.pendown()
t.circle(105, 15)
t.circle(80, 20)
t.circle(60, 80)
t.circle(15, 40)
t.circle(140, 30)
#red right
t.color('#b22222')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 72.5)
t.pendown()
t.circle(-107.5, 15)
t.circle(-82.5, 20)
t.circle(-62.5, 80)
t.circle(-17.5, 40)
t.circle(-142.5, 30)
#red left
t.penup()
t.setheading(180)
t.goto(0, 72.5)
t.pendown()
t.circle(107.5, 15)
t.circle(82.5, 20)
t.circle(62.5, 80)
t.circle(17.5, 40)
t.circle(142.5, 30)
#purple right
t.color('#9A32CD')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 75)
t.pendown()
t.circle(-110, 15)
t.circle(-85, 20)
t.circle(-65, 80)
t.circle(-20, 40)
t.circle(-145, 30)
#purple left
t.penup()
t.setheading(180)
t.goto(0, 75)
t.pendown()
t.circle(110, 15)
t.circle(85, 20)
t.circle(65, 80)
t.circle(20, 40)
t.circle(145, 30)
#yellow right
t.color('#b8860b')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 77.5)
t.pendown()
t.circle(-112.5, 15)
t.circle(-87.5, 20)
t.circle(-67.5, 80)
t.circle(-22.5, 40)
t.circle(-147.5, 30)
#yellow left
t.penup()
t.setheading(180)
t.goto(0, 77.5)
t.pendown()
t.circle(112.5, 15)
t.circle(87.5, 20)
t.circle(67.5, 80)
t.circle(22.5, 40)
t.circle(147.5, 30)
#green right
t.color('#00CD00')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 80)
t.pendown()
t.circle(-115, 15)
t.circle(-90, 20)
t.circle(-70, 80)
t.circle(-25, 40)
t.circle(-150, 30)
#green left
t.penup()
t.setheading(180)
t.goto(0, 80)
t.pendown()
t.circle(115, 15)
t.circle(90, 20)
t.circle(70, 80)
t.circle(25, 40)
t.circle(150, 30)
#black eye shade right
t.color('black')
t.fillcolor('black')
t.penup()
t.goto(20, 40)
t.pendown()
t.setheading(70)
t.begin_fill()
t.circle(-7.5, 40)
t.circle(-12.5, 20)
t.circle(-29, 100)
t.circle(-12.5, 20)
t.circle(-10, 60)
t.circle(-29, 100)
t.circle(-12.5, 20)
t.circle(-7.5, 40)
t.end_fill()
#black eye shade left
t.color('black')
t.fillcolor('black')
t.penup()
t.goto(-20, 40)
t.pendown()
t.setheading(110)
t.begin_fill()
t.circle(7.5, 40)
t.circle(12.5, 20)
t.circle(29, 100)
t.circle(12.5, 20)
t.circle(10, 60)
t.circle(29, 100)
t.circle(12.5, 20)
t.circle(7.5, 40)
t.end_fill()
#white circle part right
t.color('white')
t.penup()
t.setheading(0)
t.goto(36, 38)
t.pendown()
t.circle(-10, 360)
t.penup()
t.goto(39, 30.5)
t.pendown()
t.circle(1, 360)
#white circle part left
t.color('white')
t.penup()
t.goto(-36, 38)
t.pendown()
t.circle(-10, 360)
t.penup()
t.goto(-33, 30.5)
t.pendown()
t.circle(1, 360)
#black nose
t.color('black')
t.fillcolor('black')
t.penup()
t.setheading(0)
t.goto(-2.5, 22.5)
t.pendown()
t.begin_fill()
t.forward(7.5)
t.circle(-2.5, 120)
t.circle(-15, 30)
t.setheading(150)
t.circle(-15, 30)
t.circle(-2.5, 120)
t.end_fill()

#mouth
t.color('black')
t.fillcolor('black')
t.penup()
t.goto(0, 5)
t.pendown()
t.begin_fill()
t.circle(25, 40)
t.setheading(150)
t.forward(2.5)
t.right(180)
t.circle(-20, 50)
t.circle(-10, 50)
t.circle(-22.5, 30)
t.circle(-20, 80)
t.circle(-22.5, 20)
t.circle(-10, 30)

t.forward(3.5)
t.setheading(-35)
t.circle(15, 45)
t.end_fill()
#tongue
t.color('red')
t.fillcolor('red')
t.penup()
t.goto(-9, -10)
t.pendown()
t.setheading(60)
t.begin_fill()
t.circle(-15, 135)
t.setheading(-147)
t.circle(-22.5, 30)
t.circle(-20, 45)
t.end_fill()
#outline right
t.color('black')
t.pensize(1.5)
t.setheading(0)
t.penup()
t.goto(0, 117.5)
t.pendown()
t.circle(-102.5, 23)
t.setheading(75)
t.circle(-17.5, 105)
t.circle(-40, 75)
t.setheading(-55)
t.circle(-150, 24)
t.setheading(60)
t.circle(-17.5, 140)
t.circle(-40, 55)
t.circle(-55, 32)
t.setheading(-100)
t.circle(-160, 24)
t.setheading(-90)
t.forward(40)
t.circle(-7.5, 87)
t.forward(35)
t.circle(-50, 5)
t.circle(-30, 10)
t.circle(-3.5, 95)
t.circle(30, 15)
t.setheading(75)
t.forward(12)
t.setheading(90)
t.circle(5, 90)
t.forward(27)
#outline left
t.color('black')
t.pensize(1.5)
t.setheading(180)
t.penup()
t.goto(0, 117.5)
t.pendown()
t.circle(102.5, 23)
t.setheading(105)
t.circle(17.5, 105)
t.circle(40, 75)
t.setheading(-125)
t.circle(140, 42)
t.setheading(-125)
t.forward(32.5)
t.circle(20, 160)
t.circle(15, 40)


t.setheading(-70)
t.circle(140, 14)


t.forward(40)
time.sleep(2)
t.circle(7.5, 87)
time.sleep(2)
t.forward(35)
time.sleep(2)
t.circle(50, 5)
time.sleep(2)
t.circle(30, 10)
time.sleep(2)
t.circle(3.5, 95)
time.sleep(2)
t.circle(-30, 15)
time.sleep(2)
t.setheading(105)
time.sleep(2)
t.forward(12)
time.sleep(2)
t.setheading(90)
time.sleep(2)
t.circle(-5, 90)
time.sleep(2)
t.forward(27)
time.sleep(2)
t.hideturtle()
time.sleep(2)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
阿兹卡班毕业生阿兹卡班毕业生

错误:time库没有导入

改正:

import turtle as t
import time
# t.screensize(1500,1500,'white')
t.speed(0)
t.pensize(5)
t.color('black')
t.hideturtle()
t.delay(0)
#ear right
t.penup()
t.goto(42.25, 100.5)
t.pendown()
t.fillcolor('black')
t.begin_fill()
t.setheading(75)
t.circle(-15, 100)
t.circle(-30, 86)
t.end_fill()
#ear right
t.penup()
t.goto(-42.25, 100.5)
t.pendown()
t.begin_fill()
t.setheading(105)
t.circle(15, 100)
t.circle(30, 86)
t.end_fill()
#body shape right
t.penup()
t.goto(0, 110)
t.setheading(0)
t.pendown()
t.circle(-100, 85)
t.circle(-195, 35)
t.right(5)
t.circle(-12.5, 30)
t.circle(-150, 30)
#body shape left
t.penup()
t.goto(0, 110)
t.pendown()
t.setheading(180)
t.circle(100, 85)
t.circle(195, 35)
t.left(5)
t.circle(12.5, 30)
t.circle(150, 30)
#right hand
t.pensize(2.5)
t.penup()
t.goto(100, -5)
t.pendown()
t.setheading(60)
t.fillcolor('black')
t.begin_fill()
t.forward(20)
t.circle(-15, 140)
t.circle(-27.5, 30)
t.circle(-32.5, 78)
t.end_fill()
#little red heart
t.pensize(1)
t.color('red')
t.fillcolor('red')
t.penup()
t.goto(122.5, 7.5)
t.pendown()
t.setheading(120)
t.begin_fill()
t.forward(3.5)
t.circle(2.5, 160)
t.right(10)
t.circle(7.5, 60)
t.forward(3.6)
t.setheading(35)
t.forward(5)
t.circle(7.5, 40)
t.circle(2.5, 180)
t.right(30)
t.forward(3.5)
t.end_fill()
#left hand
t.color('black')
t.fillcolor('black')
t.pensize(2.5)
t.penup()
t.goto(-101, -22.5)
t.begin_fill()
t.setheading(-125)
t.pendown()
t.forward(35)
t.circle(15, 160)
t.circle(12.5, 40)
t.circle(25, 25)
t.end_fill()
#right foot
t.fillcolor('black')
t.penup()
t.goto(32.5, -112.5)
t.begin_fill()
t.setheading(-90)
t.pendown()
t.forward(15)
t.circle(-20, 32)
t.circle(3.5, 110)
t.circle(30, 10)
t.circle(50, 5)
t.forward(24)
t.circle(7.5, 90)
t.forward(39)
t.setheading(-158)
t.forward(40)
t.end_fill()
#left foot
t.fillcolor('black')
t.penup()
t.goto(-32.5, -112.5)
t.begin_fill()
t.setheading(-90)
t.pendown()
t.forward(15)
t.circle(20, 32)
t.circle(-3.5, 110)
t.circle(-30, 10)
t.circle(-50, 5)
t.forward(24)
t.circle(-7.5, 90)
t.forward(39)
t.setheading(-22)
t.forward(40)
t.end_fill()
#circles
#blue right
t.color('#喵95ED')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 70)
t.pendown()
t.circle(-105, 15)
t.circle(-80, 20)
t.circle(-60, 80)
t.circle(-15, 40)
t.circle(-140, 30)
#blue left
t.penup()
t.setheading(180)
t.goto(0, 70)
t.pendown()
t.circle(105, 15)
t.circle(80, 20)
t.circle(60, 80)
t.circle(15, 40)
t.circle(140, 30)
#red right
t.color('#b22222')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 72.5)
t.pendown()
t.circle(-107.5, 15)
t.circle(-82.5, 20)
t.circle(-62.5, 80)
t.circle(-17.5, 40)
t.circle(-142.5, 30)
#red left
t.penup()
t.setheading(180)
t.goto(0, 72.5)
t.pendown()
t.circle(107.5, 15)
t.circle(82.5, 20)
t.circle(62.5, 80)
t.circle(17.5, 40)
t.circle(142.5, 30)
#purple right
t.color('#9A32CD')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 75)
t.pendown()
t.circle(-110, 15)
t.circle(-85, 20)
t.circle(-65, 80)
t.circle(-20, 40)
t.circle(-145, 30)
#purple left
t.penup()
t.setheading(180)
t.goto(0, 75)
t.pendown()
t.circle(110, 15)
t.circle(85, 20)
t.circle(65, 80)
t.circle(20, 40)
t.circle(145, 30)
#yellow right
t.color('#b8860b')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 77.5)
t.pendown()
t.circle(-112.5, 15)
t.circle(-87.5, 20)
t.circle(-67.5, 80)
t.circle(-22.5, 40)
t.circle(-147.5, 30)
#yellow left
t.penup()
t.setheading(180)
t.goto(0, 77.5)
t.pendown()
t.circle(112.5, 15)
t.circle(87.5, 20)
t.circle(67.5, 80)
t.circle(22.5, 40)
t.circle(147.5, 30)
#green right
t.color('#00CD00')
t.pensize(2.5)
t.penup()
t.setheading(0)
t.goto(0, 80)
t.pendown()
t.circle(-115, 15)
t.circle(-90, 20)
t.circle(-70, 80)
t.circle(-25, 40)
t.circle(-150, 30)
#green left
t.penup()
t.setheading(180)
t.goto(0, 80)
t.pendown()
t.circle(115, 15)
t.circle(90, 20)
t.circle(70, 80)
t.circle(25, 40)
t.circle(150, 30)
#black eye shade right
t.color('black')
t.fillcolor('black')
t.penup()
t.goto(20, 40)
t.pendown()
t.setheading(70)
t.begin_fill()
t.circle(-7.5, 40)
t.circle(-12.5, 20)
t.circle(-29, 100)
t.circle(-12.5, 20)
t.circle(-10, 60)
t.circle(-29, 100)
t.circle(-12.5, 20)
t.circle(-7.5, 40)
t.end_fill()
#black eye shade left
t.color('black')
t.fillcolor('black')
t.penup()
t.goto(-20, 40)
t.pendown()
t.setheading(110)
t.begin_fill()
t.circle(7.5, 40)
t.circle(12.5, 20)
t.circle(29, 100)
t.circle(12.5, 20)
t.circle(10, 60)
t.circle(29, 100)
t.circle(12.5, 20)
t.circle(7.5, 40)
t.end_fill()
#white circle part right
t.color('white')
t.penup()
t.setheading(0)
t.goto(36, 38)
t.pendown()
t.circle(-10, 360)
t.penup()
t.goto(39, 30.5)
t.pendown()
t.circle(1, 360)
#white circle part left
t.color('white')
t.penup()
t.goto(-36, 38)
t.pendown()
t.circle(-10, 360)
t.penup()
t.goto(-33, 30.5)
t.pendown()
t.circle(1, 360)
#black nose
t.color('black')
t.fillcolor('black')
t.penup()
t.setheading(0)
t.goto(-2.5, 22.5)
t.pendown()
t.begin_fill()
t.forward(7.5)
t.circle(-2.5, 120)
t.circle(-15, 30)
t.setheading(150)
t.circle(-15, 30)
t.circle(-2.5, 120)
t.end_fill()

#mouth
t.color('black')
t.fillcolor('black')
t.penup()
t.goto(0, 5)
t.pendown()
t.begin_fill()
t.circle(25, 40)
t.setheading(150)
t.forward(2.5)
t.right(180)
t.circle(-20, 50)
t.circle(-10, 50)
t.circle(-22.5, 30)
t.circle(-20, 80)
t.circle(-22.5, 20)
t.circle(-10, 30)

t.forward(3.5)
t.setheading(-35)
t.circle(15, 45)
t.end_fill()
#tongue
t.color('red')
t.fillcolor('red')
t.penup()
t.goto(-9, -10)
t.pendown()
t.setheading(60)
t.begin_fill()
t.circle(-15, 135)
t.setheading(-147)
t.circle(-22.5, 30)
t.circle(-20, 45)
t.end_fill()
#outline right
t.color('black')
t.pensize(1.5)
t.setheading(0)
t.penup()
t.goto(0, 117.5)
t.pendown()
t.circle(-102.5, 23)
t.setheading(75)
t.circle(-17.5, 105)
t.circle(-40, 75)
t.setheading(-55)
t.circle(-150, 24)
t.setheading(60)
t.circle(-17.5, 140)
t.circle(-40, 55)
t.circle(-55, 32)
t.setheading(-100)
t.circle(-160, 24)
t.setheading(-90)
t.forward(40)
t.circle(-7.5, 87)
t.forward(35)
t.circle(-50, 5)
t.circle(-30, 10)
t.circle(-3.5, 95)
t.circle(30, 15)
t.setheading(75)
t.forward(12)
t.setheading(90)
t.circle(5, 90)
t.forward(27)
#outline left
t.color('black')
t.pensize(1.5)
t.setheading(180)
t.penup()
t.goto(0, 117.5)
t.pendown()
t.circle(102.5, 23)
t.setheading(105)
t.circle(17.5, 105)
t.circle(40, 75)
t.setheading(-125)
t.circle(140, 42)
t.setheading(-125)
t.forward(32.5)
t.circle(20, 160)
t.circle(15, 40)


t.setheading(-70)
t.circle(140, 14)


t.forward(40)
time.sleep(2)
t.circle(7.5, 87)
time.sleep(2)
t.forward(35)
time.sleep(2)
t.circle(50, 5)
time.sleep(2)
t.circle(30, 10)
time.sleep(2)
t.circle(3.5, 95)
time.sleep(2)
t.circle(-30, 15)
time.sleep(2)
t.setheading(105)
time.sleep(2)
t.forward(12)
time.sleep(2)
t.setheading(90)
time.sleep(2)
t.circle(-5, 90)
time.sleep(2)
t.forward(27)
time.sleep(2)
t.hideturtle()
time.sleep(2)

点赞0


评论