1. 程式人生 > >畫一顆小心心送給你

畫一顆小心心送給你

#手的第一部分
import turtle
turtle.setup(650,350,200,200)
turtle.seth(45)
turtle.fd(50)
turtle.seth(135)
turtle.fd(50)
turtle.penup()
turtle.seth(-45)
turtle.fd(10)
turtle.seth(45)
turtle.fd(10)
turtle.pendown()
turtle.seth(135)
turtle.circle(10,90)
turtle.circle(10,-90)
turtle.seth(-45)
turtle.fd(40)
#手的第二部分
turtle.seth(180)
turtle.circle(
15,-180) turtle.circle(15,180) turtle.seth(45) turtle.fd(60) turtle.penup() turtle.seth(-135) turtle.fd(10) turtle.seth(-45) turtle.fd(10) turtle.seth(45) turtle.pendown() turtle.circle(10,90) #手的第三部分 turtle.circle(10,-90) turtle.seth(-135) turtle.fd(40) turtle.seth(-45) turtle.fd(20) turtle.seth(135) turtle.circle(
5,-180) turtle.seth(135) turtle.fd(10) turtle.seth(-135) turtle.seth(-45) turtle.fd(10) turtle.circle(5,90) turtle.seth(-135) turtle.fd(60) turtle.seth(45) turtle.fd(60) turtle.circle(5,-90) #心形 turtle.pencolor("red") turtle.penup() turtle.seth(45) turtle.fd(90) turtle.fd(20) turtle.seth(0) turtle.pendown() turtle.circle(
30,135) turtle.circle(15,180) turtle.seth(45) turtle.circle(15,180) turtle.circle(30,135) turtle.circle(30,135)

點此檢視視訊