当前位置:网站首页>【程序员必备】七夕表白攻略:”月遇从云,花遇和风,晚上的夜空很美“。(附源码合集)
【程序员必备】七夕表白攻略:”月遇从云,花遇和风,晚上的夜空很美“。(附源码合集)
2022-07-26 03:33:00 【顾木子吖】
导语
月遇从云,花遇和风,今晚上的夜空很美。
原句:“月遇从云,花遇和风,今晚上的夜空很美,我又想你。”——太宰治

所有文章完整的素材+源码都在
哈喽!我是木木子,一个会学代码(bug)也能教你们谈恋爱的低手程序猿!
不会吧!不会吧!现在都农历六月份了,你还是单身嘛?

自古七夕多惆怅。
小编:距离七夕没剩下一个月了。你准备怎么过?
你说:嗯,什么?七夕到了?七夕是什么,能吃吗?你问我怎么过???


作为一个资深的bug程序员,我不允许你们现在还单身,于是我写了这篇文章。
下面这几个7.7表白代码发给你的女神叭,还没有女朋友直接来找我!
正文
一、玫瑰到了花期
1)效果展示

2)源码展示
from turtle import *
setup(650, 750, 0, 0)
colormode(255)
pencolor("black")
pu()
goto(-30, -66)
pd()
begin_fill()
color("black", "red")
seth(105)
circle(-80, 100)
circle(-200, 55)
seth(209)
circle(-332, 43)
end_fill()
pu()
begin_fill()
color("black", (139,69,19))
goto(-49, -64)
pd()
seth(135)
fd(23)
seth(252)
fd(32)
seth(242)
circle(1100, 8)
seth(0)
fd(10)
seth(70)
circle(-760, 13)
end_fill()
pu()
goto(-99, -153)
color("black", "green")
pd()
begin_fill()
seth(55)
circle(-80, 90)
seth(190)
end_fill()
fd(110)
pu()
goto(-95, -163)
pd()
begin_fill()
backward(100)
seth(225)
circle(-90, 70)
end_fill()
pu()
goto(-107,-89)
pd()
begin_fill()
seth(120)
fd(110)
seth(340)
circle(-90, 80)
end_fill()
pu()
goto(-107, -106)
pd()
begin_fill()
seth(120)
fd(90)
seth(250)
circle(60, 100)
end_fill()
pu()
goto(-73, -25)
color("black", "red")
pd()
begin_fill()
seth(90)
circle(260, 50)
seth(45)
fd(130)
seth(330)
circle(-120, 50)
seth(230)
fd(35)
seth(120)
fd(40)
seth(45)
backward(20)
seth(300)
circle(-200, 60)
end_fill()
pu()
goto(-45, -50)
pd()
begin_fill()
seth(135)
fd(25)
seth(60)
circle(200, 40)
seth(40)
circle(200, 50)
seth(300)
fd(110)
seth(240)
circle(500, 13)
seth(190)
circle(105, 85)
end_fill()
pu()
goto(105, 40)
pd()
begin_fill()
seth(350)
circle(-200, 30)
seth(35)
fd(30)
seth(115)
circle(-400, 32)
seth(160)
circle(120, 50)
seth(290)
fd(50)
seth(20)
fd(35)
seth(300)
circle(-120, 40)
seth(220)
fd(50)
seth(250)
fd(40)
end_fill()
pu()
goto(85, 44)
pd()
begin_fill()
seth(65)
circle(250, 27)
seth(200)
fd(15)
seth(270)
fd(30)
seth(220)
circle(100, 50)
seth(355)
fd(28)
end_fill()
goto(117, 100)
pd()
begin_fill()
seth(30)
fd(13)
seth(120)
fd(20)
seth(270)
fd(25)
end_fill()
pu()
goto(122, 145)
pd()
begin_fill()
seth(335)
fd(15)
seth(120)
fd(30)
seth(270)
fd(25)
end_fill()
二、月亮很亮
1)效果展示

2)代码展示
import turtle as t
t.setup(800,800)
t.hideturtle()
t.speed(11)
t.penup()
t.goto(50,-450)
t.pensize(5)
t.pencolor("black")
t.seth(140)
t.pendown()
t.speed(10)
t.circle(-300,60)
t.fd(100)
#叶子
t.seth(10)
t.fd(50)
t.fillcolor("green")
t.begin_fill()
t.right(40)
t.circle(120,80)
t.left(100)
t.circle(120,80)
t.end_fill()
t.seth(10)
t.fd(90)
t.speed(11)
t.penup()
t.fd(-140)
t.seth(80)
#一片叶子
t.pendown()
t.speed(10)
t.fd(70)
t.seth(160)
t.fd(50)
t.fillcolor("green")
t.begin_fill()
t.right(40)
t.circle(120,80)
t.left(100)
t.circle(120,80)
t.end_fill()
t.seth(160)
t.fd(90)
t.speed(11)
t.penup()
t.fd(-140)
t.seth(80)
t.pendown()
t.speed(10)
#
t.fd(100)
#花瓣
t.seth(-20)
t.fillcolor("blue")
t.begin_fill()
t.circle(100,100)
t.circle(-110,70)
t.seth(179)
t.circle(223,76)
t.end_fill()
#2花瓣
t.speed(11)
t.fillcolor("blue")
t.begin_fill()
t.left(180)
t.circle(-223,60)
t.seth(70)
t.speed(10)
t.circle(-213,15)#55
t.left(70)#125
t.circle(200,70)
t.seth(-80)
t.circle(-170,40)
t.circle(124,94)
t.end_fill()
#
t.speed(11)
t.penup()
t.right(180)
t.circle(-124,94)
t.circle(170,40)
t.pendown()
t.speed(10)
t.seth(-60)
t.circle(175,70)
t.seth(235)
t.circle(300,12)
t.right(180)
t.circle(-300,12)
t.seth(125)
t.circle(150,60)
t.seth(70)
t.fd(-20)
t.fd(20)
t.seth(-45)
t.circle(150,40)
t.seth(66)
t.fd(-18.5)
t.fd(18.5)
t.seth(140)
t.circle(150,27)
t.seth(60)
t.fd(-8)
t.speed(11)
t.penup()
t.left(20.8)
t.fd(-250.5)
#3花瓣
t.pendown()
t.speed(10)
t.fillcolor("blue")
t.begin_fill()
t.seth(16)
t.circle(-140,85)
t.circle(100,70)
t.right(165)
t.circle-200,32)
t.speed(11)
t.seth(-105)
t.circle(-170,14.5)
t.circle(123,94)
t.end_fill()三、爱心接收
1)效果展示

2)代码展示
from turtle import *
def go_to(x, y):
up()
goto(x, y)
down()
#第一个小人开始制作
def head(x,y,r): #头
go_to(x,y)
circle(r)
leg(x,y)
def leg(x,y):#腿
right(90)
forward(180)
right(30)
forward(100)
left(120)
go_to(x,y-180)
forward(100)
right(120)
forward(100)
left(120)
hand(x,y)
def hand(x,y):#手
go_to(x,y-60)
forward(100)
left(60)
forward(100)
go_to(x, y - 90)
right(60)
forward(100)
right(60)
forward(100)
left(60)
eye(x,y)
def eye(x,y):#眼睛
go_to(x-50,y+130)
right(90)
forward(50)
go_to(x+40,y+130)
forward(50)
left(90)
#第一个小人制作结束
#第二个小人制作开始
def head1(x,y,r):
go_to(x,y)
circle(r)
leg1(x,y)
def leg1(x,y):
right(90)
forward(180)
left(30)
forward(100)
right(120)
go_to(x,y-180)
forward(100)
left(120)
forward(100)
right(120)
hand1(x,y)
def hand1(x,y):
go_to(x,y-60)
left(180)
forward(-180)
left(60)
forward(100)
go_to(x, y - 90)
right(60)
forward(-180)
right(60)
forward(100)
left(60)
eye1(x,y)
def eye1(x,y):
go_to(x-50,y+130)
right(90)
forward(50)
go_to(x+40,y+130)
forward(50)
left(90)
#第二个小人制作结束
#爱心制作
def big_Circle(size):
for i in range(150):
forward(size)
right(0.3)
def line(size):
forward(51*size)
def small_Circle(size):
for i in range(210):
forward(size)
right(0.786)
def heart(x, y, size):
go_to(x, y)
left(150)
begin_fill()
line(size)
big_Circle(size)
small_Circle(size)
left(120)
small_Circle(size)
big_Circle(size)
line(size)
end_fill()
#爱心制作结束
def main():
pensize(2)
color('black', 'pink')
head(-400, 100, 100)
head1(300,100,100)
heart(-50, -80, 1)
go_to(200, -300)
四、隐藏表白
1)效果展示
放大放大都是我喜欢你

2)代码展示
from PIL import Image, ImageDraw, ImageFont
font_size = 7
text = "我喜欢你!"
img_path = "66.jpg"
img_raw = Image.open(img_path)
img_array = img_ra.load()
img_new = Image.new("RGB", img_raw.size, (0, 0, 0))
draw = ImageDraw.Draw(img_new)
font = ImageFont.truetype('Calibri.ttf', font_size)
def character_generator(text):
while True:
for i in range(len(text)):
yield text[i]
ch_gen = character_generator(text)
for y in range(0, img_raw.size[1], font_size):
for x in range(0, img_raw.size[0], font_size):
draw.text((x, y), next(ch_gen), font=font, fill=img_array[x, y], direction=None)
img_new.convert('RGB').save("save_06.jpeg")
五、表白树
1)效果展示

2)代码展示
import turtle
import random
def love(x,y):#在(x,y)处画爱心lalala
lv=turtle.Turtle()
lv.hideturtle()
lv.up()
lv.goto(x,y)#定位到(x,y)
def curvemove():#画圆弧
for i in range(20):
lv.right(10)
lv.forward(2)
lv.color('red','pink')
lv.speed(10000000)
lv.pensize(1)
#开始画爱心lalala
lv.down()
lv.begin_fill()
lv.left(140)
lv.forward(22)
curvemove()
lv.left(120)
curvemove()
lv.forward(22)
lv.write(" ",font=("Arial",12,"normal"),align="center")#写上表白的人的名字
lv.left(140)#画完复位
lv.end_fill()
def tree(branchLen,t):
if branchLen > 5:#剩余树枝太少要结束递归
if branchLen<20:
t.color("green")
t.pensize(random.uniform((branchLen + 5) / 4 - 2, (branchLen + 6) / 4 + 5))
t.down()
t.forward(branchLen)
love(t.xcor(),t.ycor())#传输现在turtle的坐标
t.up()
t.backward(branchLen)
t.color("brown")
return
t.pensize(random.uniform((branchLen+5)/4-2,(branchLen+6)/4+5))
t.down()
t.forward(branchLen)
# 以下递归
ang=random.uniform(15,45)
t.right(ang)
tree(branchLen-random.uniform(12,16),t)#随机决定减小长度
t.left(2*ang)
tree(branchLen-random.uniform(12,16),t)#随机决定减小长度
t.right(ang)
t.up()
t.backward(branchLen)
myWin = turtle.Screen()
t = turtle.Turtle()
t.hideturtle()
t.speed(1000)
t.left(90)
t.up()
t.backward(200)
t.down()
t.color("brown")
t.pensize(32)
t.forward(60)
六、Bui Bui Bui 爱你
1)效果展示

2)代码展示
from turtle import *
forward(200) # 从当前画笔方向移动200
left(90) # 逆时针移动90°
backward(200) # 在当前画笔方向的反方向移动200
right(90) # 顺时针移动90°
circle(200) # 画一个半径为200的圆,圆心在画笔左边
def heart(x, y, size):
go_to(x, y)
left(150)
begin_fill()
forward(51*size)
ring(150,size,0.3,'right')
ring(210,size,0.786,'right')
left(120)
ring(210,size,0.786,'right')
ring(150,size,0.3,'right')
forward(51*size)
end_fill()
#头部
color('black')
go_to(-228, 72)
pensize(3)
left(150)
ring(350,1,0.8,'right')
#手臂
left(150)
forward(70)
left(90)
forward(10)
ring(200,0.1,0.9,'right')
forward(10)
left(90)
forward(20)
ring(200,0.1,0.9,'right')
forward(10)
left(90)
ring(200,0.2,0.9,'right')
left(100)
left
forward(80)
# 添加文字
go_to(-39, 69)
write("520", align="left", font=("黑体", 30, "normal"))
七、想你时认真哒
1)效果展示

2)代码展示
t=turtle.pen()
t=turtle
t.up()
t.goto(0,150)
t.down()
t.color('pink')
t.begin_fill()
t.fillcolor('pink')
t.speed(1)
t.left(45)
t.forward(150)
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(250+math.sqrt(2)*100)
t.right (90)
t.speed(2)
t.forward(250+100*math.sqrt(2))
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(100)
t.right(45)
t.forward(150)
t.end_fill()
t.goto(-10,0)
t.pencolor('white')
#L
t.pensize(10)
t.goto(-50,0)
t.goto(-50,80)
t.up ()
#I
t.goto(-100,0)
t.down()
t.goto(-160,0)
t.goto(-130,0)
t.goto(-130,80)
t.goto(-160,80)
t.goto(-100,80)
t.up()
#O
t.goto(10,25)
t.down()
t.right(45)
t.circle(25,extent=180)
t.goto(60,55)
t.circle(25,extent=180)
t.goto(10,25)
t.up()
t.goto(75,80)
t.down()
t.goto(100,0)
t.goto(125,80)
t.up()
t.goto(180,80)
t.down()
t.goto(140,80)
t.goto(140,0)
t.goto(180,0)
t.up()
t.goto(180,40)
t.down()
t.goto(140,40)
#U
t.up()
t.goto(-40,-30)
t.down()
t.goto(-40,-80)
t.circle(40,extent=180)
t.goto(40,-30)
t.hideturtle()
a=input()
总结
愿做个逗号 原句:
世事如书,我偏爱你这一句愿做个逗号,待在你脚边.
——张嘉佳《从你的全世界路过》

完整的免费源码领取处:找我吖!文末公众hao可自行领取,滴滴我也可!
推荐往期文章——
项目1.0 烟花玫瑰(内含多份源码)
Python表白代码:“ 星光月夜烟花皆归你,我也归你”(满天烟花盛开、附番外玫瑰)
项目1.1 恋爱指南(内含多份源码)
【Python恋爱指南】二款甜度爆表的小程序出炉—还怕找不到对象嘛?
项目1.7 恋爱纪念日
【Python纪念册】一屋两人三餐四季:“距离百年好合只剩xx年了~“多少?进来看看就知道了。
项目1.8 故宫,下雪了
【故宫,下雪了】一夜醒来,故宫完成秋冬交接,来自北方的故事纷纷踏雪而来(内含多份源码)
文章汇总——
项目1.0 Python—2021 |已有文章汇总 | 持续更新,直接看这篇就够了
(更多内容+源码都在文章汇总哦!!欢迎阅读~)
边栏推荐
- Illustration leetcode - 5. Longest palindrome substring (difficulty: medium)
- Implement a method to find the sum of the number k and m in the array
- ELS message loop
- PXE高效批量网络装机
- Understand preloading and lazy loading, and learn slow animation
- ByteDance (Tiktok) software test monthly salary 23K post, technical two-sided interview questions are newly released
- Use VRRP technology to realize gateway equipment redundancy, with detailed configuration experiments
- QT笔记——Q_Q 和Q_D 学习
- tf.truncated_normal()用法
- Course notes of single chip microcomputer principle and interface technology for migrant workers majoring in electronic information engineering
猜你喜欢

Illustration leetcode - 5. Longest palindrome substring (difficulty: medium)

bond网络模式配置

Apply for SSL certificate, configure SSL certificate for domain name, and deploy server; Download and installation of SSL certificate

ByteDance (Tiktok) software test monthly salary 23K post, technical two-sided interview questions are newly released
![[mathematical modeling - Summary of planning model] | matlab solution](/img/b0/a4d33d7d7b605b7cc6149b59b55fb8.png)
[mathematical modeling - Summary of planning model] | matlab solution

Use Anaconda to configure the tensorflow of GPU Version (less than 30 series graphics cards)

赶紧进来!!!用c语言基础知识几十行代码写一个猜数字小游戏

"Xiao Deng's view" the value brought by Siem to enterprises (II)

【创建交互式 Dice Roller 应用】

Uncaught TypeError: $(...). Onmousenter is not a function JS error, solution:
随机推荐
Looking at the next step of BAIC bluevale through the 8billion fund-raising, product upgrading and building core capabilities are the key words
ue4如何进行静态渲染?5个步骤生成静态渲染
Uncaught TypeError: $(...). Onmousenter is not a function JS error, solution:
Canvas - ECG design and how to clean the canvas
leetcode-169.多数元素
Use VRRP technology to realize gateway equipment redundancy, with detailed configuration experiments
What are you interviewing for in a big factory? It's worth watching (I)
Installation and operation of orb-slam2 under ROS
"Xiao Deng's view" the value brought by Siem to enterprises (II)
Unity quickly builds urban scenes
C language preprocessing instructions and makefile script explanation
Dominate the salary list! What industry has a "money" path?
Implement a method to find the sum of the number k and m in the array
What are the methods of array sorting in JS
阿里二面:千万级数据量的表,快速查询如何进行?
使用VRRP技术实现网关设备冗余,附详细配置实验
Mbr3045ct Schottky diode, mbr0100, mbr2060ct diode parameters
2022-07-21 study notes of group 4 self-cultivation class (every day)
What is the difference between heap memory and stack memory?
Sersync/lsync real-time synchronization