在情人节送给自己的女朋友玫瑰花, 对于程序员来说是不是太普通了呢? 为什么不试试让情人节变得更特别一些呢? 作为一名程序员, 可以用自己的技术创造出不一样的浪漫! 让你的女朋友眼前一亮,印象深刻。 这些浪漫的技术表白,你值得拥有。
先来暖个场吧!
- 浪漫玫瑰
from turtle import *import time setup(1000,800,0,0)speed(0)penup()seth(90)fd(300)seth(0)pendown() speed(5)begin_fill()fillcolor('red')circle(50,30) for i in range(10): fd(1) left(10) circle(40,40) for i in range(6): fd(1) left(3) circle(80,40) for i in range(20): fd(0.5) left(5) circle(80,45) for i in range(10): fd(2) left(1) circle(80,25) for i in range(20): fd(1) left(4) circle(50,50) time.sleep(0.1) circle(120,55) speed(3) seth(-90)fd(70) right(150)fd(20) left(140)circle(140,90) left(30)circle(160,100) left(130)fd(25) penup()right(150)circle(40,80)pendown() left(115)fd(60) penup()left(180)fd(60)pendown() end_fill() right(120)circle(-50,50)circle(-20,90) speed(1)fd(75) speed(0)circle(90,110) penup()left(162)fd(185)left(170)pendown()circle(200,10)circle(100,40)circle(-52,115)left(20)circle(100,20)circle(300,20)speed(1)fd(250) penup()speed(0)left(180)fd(250)circle(-300,7)right(80)circle(200,5)pendown() left(60)begin_fill()fillcolor('green')circle(-80,100)right(90)fd(10)left(20)circle(-63,127)end_fill() penup()left(50)fd(20)left(180) pendown()circle(200,25) penup()right(150) fd(180) right(40)pendown()begin_fill()fillcolor('green')circle(-100,80)right(150)fd(10)left(60)circle(-80,98)end_fill() penup()left(60)fd(13)left(180) pendown()speed(3)circle(-200,23)penup()left(90)backward(40)pendown()color("deep pink")write("My Honey", font=("Courier", 30, "italic"), align="center")hideturtle() exitonclick()
- 丘比特之剑
from turtle import*color ("black","red")pensize(5)begin_fill()penup()goto(50,50)pendown()right(45)goto(100,0)left(90)fd(120)circle(50,225)penup()goto(0,0)pendown()left(135)fd(120)circle(50,225)seth(90)circle(50,225)fd(121)end_fill()left(56)penup()goto(-210,40)pendown()goto(0,80)penup()goto(160,110)pendown()goto(320,140)##penup()##left(80)##forward(20)##pendown()color("deep pink")write("Happy Qixi festival,\n my honey", font=("Courier", 20, "italic"), align="left")##hideturtle()done()
总感觉还缺点什么,最后再放个大招吧!
今年七夕节不妨就送给爱人一个别致的礼物吧!
如想获取源代码,请关注我们公众号,输入关键词【表白树】。如就想制作一段小视频送给爱人,同样关注公众号联系我们!