如何用Python画一个哆啦A梦 #coding=utf-8 #Drawcat 画多啦A梦 from turtle import * # 无轨迹跳跃 def my_goto(x, y): penup() goto(x, y) pendown() # 眼睛 def eyes(): tracer(False) a = 2.5 for i in range(120): if 0 <= i < 30 or 60 <= i < 90: a -= 0.05 lt(3) fd(a) else: a += 0.05 lt(3) fd(a) tracer(True) # 胡须 def beard(): my_goto(-37, 135) seth(165) fd(60) my_goto(-37, 125) seth(180) fd(60) my_goto(-37, 115) seth(193) fd(60) my_goto(37, 135) seth(15) fd(60) my_goto(37, 125) seth(0) fd(60) my_goto(37, 115) seth(-13) fd(60) # 嘴巴 def mouth(): my_goto(5, 148) seth(270) fd(100) seth(0) circle(120, 50) seth(230) circle(-120, 100) # 围巾 def scarf(): fillcolor(‘#e70010’) begin_fill() seth(0) fd(200) circle(-5, 90) fd(10) circle(-5, 90) fd(207) circle(-5, 90) fd(10) circle(-5, 90) end_fill() # 鼻子 def nose(): my_goto(-10, 158) fillcolor(‘#e70010’) begin_fill() circle(20) end_fill() # 黑眼睛 def black_eyes(): seth(0) my_goto(-20, 195) fillcolor(‘#000000’) begin_fill() circle(13) end_fill() pensize(6) my_goto(20, 205 …
文章归档
Directory Listing
发布于 2015年11月12日
<?php /* Directory Listing Script – Version 3 ==================================== Script Author: Ash Young <ash@evoluted.net> / www.evoluted.net