当前位置:网站首页>[programmers must] Tanabata confession strategy: "the moon meets the cloud, the flowers meet the wind, and the night sky is beautiful at night". (with source code Collection)
[programmers must] Tanabata confession strategy: "the moon meets the cloud, the flowers meet the wind, and the night sky is beautiful at night". (with source code Collection)
2022-07-26 03:41:00 【Gu Muzi acridine】
Introduction
The moon meets from the clouds , Flowers meet the wind , The night sky is beautiful tonight .
The original sentence :“ The moon meets from the clouds , Flowers meet the wind , The night sky is beautiful tonight , I miss you again .”—— Tai Zi Zhi

Complete material for all articles + The source code is in
hello ! I'm kimiko , One can learn code (bug) A low handed programmer who can also teach you to fall in love !
Won't! ! Won't! ! Now it's June in the lunar calendar , You are still single ?

Since ancient times, Tanabata has been melancholy .
Small make up : There is no more than a month left from Tanabata . What are you going to do ?
You say? : Um. , what ? Tanabata is coming ? What is Tanabata , Can you eat? ? You ask me how I live ???


As a senior bug The programmer , I don't allow you to be single now , So I wrote this article .
Here are some 7.7 Express the code to your goddess Ba , No girlfriend came to me directly !
Text
One 、 The rose is in bloom
1) Effect display

2) Source code display
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()
Two 、 The moon is bright
1) Effect display

2) Code display
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)
# leaf
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)
# A leaf
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)
# petals
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 petals
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 petals
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()3、 ... and 、 Love receiving
1) Effect display

2) Code display
from turtle import *
def go_to(x, y):
up()
goto(x, y)
down()
# The first villain began to make
def head(x,y,r): # head
go_to(x,y)
circle(r)
leg(x,y)
def leg(x,y):# leg
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):# hand
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):# eyes
go_to(x-50,y+130)
right(90)
forward(50)
go_to(x+40,y+130)
forward(50)
left(90)
# The production of the first villain is over
# The second villain production begins
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)
# The production of the second villain is over
# Love making
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()
# The production of love is over
def main():
pensize(2)
color('black', 'pink')
head(-400, 100, 100)
head1(300,100,100)
heart(-50, -80, 1)
go_to(200, -300)
Four 、 Hide your confession
1) Effect display
Zoom in. Zoom in. I like you

2) Code display
from PIL import Image, ImageDraw, ImageFont
font_size = 7
text = " I like you !"
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")
5、 ... and 、 Confession tree
1) Effect display

2) Code display
import turtle
import random
def love(x,y):# stay (x,y) Where to draw love lalala
lv=turtle.Turtle()
lv.hideturtle()
lv.up()
lv.goto(x,y)# Locate the (x,y)
def curvemove():# Draw an arc
for i in range(20):
lv.right(10)
lv.forward(2)
lv.color('red','pink')
lv.speed(10000000)
lv.pensize(1)
# Start painting love 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")# Write the name of the Confessor
lv.left(140)# Reset after drawing
lv.end_fill()
def tree(branchLen,t):
if branchLen > 5:# There are too few branches left to end recursion
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())# Transmission now turtle Coordinates of
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)
# The following recursion
ang=random.uniform(15,45)
t.right(ang)
tree(branchLen-random.uniform(12,16),t)# Random decision to reduce the length
t.left(2*ang)
tree(branchLen-random.uniform(12,16),t)# Random decision to reduce the length
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)
6、 ... and 、Bui Bui Bui love you
1) Effect display

2) Code display
from turtle import *
forward(200) # Move from the current brush direction 200
left(90) # Move counterclockwise 90°
backward(200) # Moves in the opposite direction of the current brush direction 200
right(90) # Move clockwise 90°
circle(200) # Draw a radius of 200 The circle of , The center of the circle is to the left of the brush
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()
# Head
color('black')
go_to(-228, 72)
pensize(3)
left(150)
ring(350,1,0.8,'right')
# Arms
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)
# Add text
go_to(-39, 69)
write("520", align="left", font=(" In black ", 30, "normal"))
7、 ... and 、 I miss you seriously
1) Effect display

2) Code display
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()
summary
Would like to make a comma The original sentence :
The world is like a book , I prefer your sentence Would like to make a comma , Stay at your feet .
—— Zhang Jiajia 《 Passing through your whole world 》

Complete free source code collection office : Find me ! Public at the end of the article hao You can get it by yourself , Didi, I can also !
I recommend previous articles ——
project 1.0 Fireworks roses ( Contains multiple copies Source code )
project 1.1 Love guide ( Contains multiple source code )
project 1.7 Love anniversary
project 1.8 The Forbidden City , It's snowing
A summary of the article ——
project 1.0 Python—2021 | Summary of existing articles | Continuous updating , Just read this article directly
( More + The source code is summarized in the article !! Welcome to ~)
边栏推荐
- 离线数据仓库从0到1-阶段一资源购买配置
- 2020 AF-RCNN: An anchor-free convolutional neural network for multi-categoriesagricultural pest det
- Efficient Video Instance Segmentation via Tracklet Query and Proposal
- 2022-07-21 第四小组 修身课 学习笔记(every day)
- Hcip day 14
- IDEA2020.3.1不能打开(双击不能打开),但可以通过idea.bat打开。
- TCP experimental verification
- Bracket nesting problem (recommended Collection)
- LoRa和NB-IOT可用用在哪些地方
- waf详解
猜你喜欢

UE4 how to render statically? 5 steps to generate static rendering

Why did Mr. Cao, a productionist in the field of high-end tea, choose Ruifeng L6 max?

KBPC1510-ASEMI大芯片15A整流桥KBPC1510

开源许可证的传染性问题浅析

Sersync/lsync real-time synchronization

Bond network mode configuration

【数学建模-规划模型总结】| MATLAB求解

爆肝出了4W字的Redis面试教程

Graduation season & harvest season, leave your beautiful moments

Course notes of single chip microcomputer principle and interface technology for migrant workers majoring in electronic information engineering
随机推荐
Sentinel vs Hystrix 到底怎么选?
LDP related knowledge points
Dominate the salary list! What industry has a "money" path?
MPLS基础实验配置
C语言函数(2)
URDF syntax explanation
Configuration and use of virtualservice, gateway and destinationrule of istio III
UDP和TCP可以使用同一个端口吗?
容器跑不动?网络可不背锅
ext4、ntfs、xfs、btrfs、zfs、f2fs和reiserFS性能对比
[virtualization] view the log files of vCenter and esxi hosts
B2B2C多商户系统功能丰富,极易二开
zkEVM:MINA的CEO对zkEVM和L1相关内容的总结
Alibaba Sentinel - 集群流量控制
[MySQL project practical optimization] complex trigger case sharing
6年从零开始的自动化测试之路,开发转测试我不后悔...
QT notes - temporary floating window
[stl] priority queue priority_ queue
涂鸦幻彩产品开发包如何使用
Mbr3045ct Schottky diode, mbr0100, mbr2060ct diode parameters