from turtle import * from time import sleep w = 800 h = 800 setup(w, h, 631, 44) bgcolor('#08203D') def pen_goto(a, b): up() goto(a, b) down() def ref_line(): pencolor('Grey') pensize(1) speed(0) sq = 50 dot(10, 'Gold') row_y = h/2 for i in range(int(h/sq - 1)): row_y -= sq pen_goto(- w/2, row_y) fd(w) seth(90) col_x = w/2 for i in range(int(w/sq - 1)): col_x -= sq pen_goto(col_x, - w/2) fd(h) seth(0) def head(): pen_goto(0, 0) setheading(0) up() circle(160, 40) begin_fill() down() circle(160, 280) fillcolor('#00a0de') end_fill() def scarf(): begin_fill() fillcolor('red') seth(0) fd(215) circle(-5, 90) fd(15) circle(-5, 90) fd(225) circle(-5, 90) fd(15) circle(-5, 90) fd(10) end_fill() def face(): begin_fill(
python画哆啦A梦
最新推荐文章于 2024-07-18 08:45:00 发布
这段代码使用Python的turtle模块详细绘制了哆啦A梦的形象,包括头部、围巾、脸部特征、身体、手脚、口袋和铃铛等部分。
摘要由CSDN通过智能技术生成