ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

绝对原创!教你用turtle工具画汤圆酱表情包

2020-04-22 21:57:44  阅读:779  来源: 互联网

标签:turtle goto pu 汤圆 教你用 down 90 circle fill


想必大家都很熟悉下面这个表情包吧,哈哈,我用代码做到的!

  1 # 汤圆酱代码
  2 # 作者李安国
  3 import turtle as t
  4 
  5 t.hideturtle()
  6 t.pensize(3)
  7 t.pu()
  8 t.goto(-10,0)
  9 t.down()
 10 t.lt(53)
 11 t.fd(20)
 12 t.rt(106)
 13 t.fd(20)
 14 
 15 t.pu()
 16 t.goto(72,-80)
 17 t.down()
 18 t.lt(90)
 19 t.circle(120,286)
 20 
 21 t.up()
 22 t.home()
 23 t.pu()
 24 t.goto(-48,0)
 25 t.down()
 26 t.lt(90)
 27 t.color("pink")
 28 t.fillcolor("pink")
 29 t.begin_fill()
 30 t.circle(24,360)
 31 t.end_fill()
 32 
 33 t.pu()
 34 t.goto(75,22)
 35 t.down()
 36 t.lt(90)
 37 t.color("pink")
 38 t.fillcolor("pink")
 39 t.begin_fill()
 40 t.circle(24,360)
 41 t.end_fill()
 42 
 43 t.up()
 44 t.home()
 45 t.pu()
 46 t.goto(-12,50)
 47 t.down()
 48 t.pensize(2)
 49 t.lt(90)
 50 t.color("black")
 51 t.circle(26,90)
 52 t.fd(20)
 53 t.circle(26,90)
 54 t.circle(13,90)
 55 t.fd(45)
 56 t.circle(13,90)
 57 
 58 t.up()
 59 t.home()
 60 t.pu()
 61 t.goto(90,50)
 62 t.down()
 63 t.pensize(2)
 64 t.lt(90)
 65 t.color("black")
 66 t.circle(26,90)
 67 t.fd(20)
 68 t.circle(26,90)
 69 t.circle(13,90)
 70 t.fd(45)
 71 t.circle(13,90)
 72 
 73 t.up()
 74 t.home()
 75 t.pu()
 76 t.goto(-27,56)
 77 t.down()
 78 t.lt(90)
 79 t.fillcolor("black")
 80 t.begin_fill()
 81 t.circle(19,360)
 82 t.end_fill()
 83 
 84 t.up()
 85 t.home()
 86 t.pu()
 87 t.goto(85,56)
 88 t.down()
 89 t.lt(90)
 90 t.fillcolor("black")
 91 t.begin_fill()
 92 t.circle(19,360)
 93 t.end_fill()
 94 
 95 t.up()
 96 t.home()
 97 t.pu()
 98 t.goto(-72,-80)
 99 t.down()
100 t.pensize(3)
101 t.rt(110)
102 t.circle(180,25)
103 
104 t.up()
105 t.home()
106 t.pu()
107 t.goto(-22,-120)
108 t.down()
109 t.fd(40)
110 t.circle(12,180)
111 t.fd(38)
112 
113 t.pu()
114 t.home()
115 t.rt(53)
116 t.pu()
117 t.goto(72,-80)
118 t.rt(53)
119 t.down()
120 t.circle(180,25)
121 
122 t.pu()
123 t.home()
124 t.rt(53)
125 t.pu()
126 t.goto(68,-116)
127 t.down()
128 t.circle(12,360)
129 
130 t.pu()
131 t.home()
132 t.pu()
133 t.goto(0,136)
134 t.down()
135 t.lt(90)
136 t.fd(24)
137 t.color("OliveDrab1")
138 t.fillcolor("OliveDrab1")
139 t.begin_fill()
140 t.circle(10,360)
141 t.end_fill()
142 t.lt(180)
143 t.fillcolor("OliveDrab1")
144 t.begin_fill()
145 t.circle(10,360)
146 t.end_fill()

另外这里有个查找turtle颜色库的表格:

入口

标签:turtle,goto,pu,汤圆,教你用,down,90,circle,fill
来源: https://www.cnblogs.com/angoli/p/12756229.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有