当前位置:网站首页>【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)
【Turtle表白合集】“海底月是天上月,眼前人是心上人。”余生多喜乐,长平安~(附3款源码)
2022-06-10 22:42:00 【程序员梨子】
前言
作者 :“程序员梨子”
**文章简介 **:本篇文章主要是写了使用Turtle写了几款表白的小代码啦~
**文章源码免费获取 : 为了感谢每一个关注我的小可爱每篇文章的项目源码都是无
偿分享滴
所有文章完整的素材+源码都在
正文
心里一直喜欢她,但是我也知道不是她喜欢的类型。暗恋是一个人的兵荒马乱吧,在学校我熟悉你
吃饭、取快递的时间,在这个时间点各种找借口制造偶遇,其实只是想多看你一眼啊。见到你就
躲,见不到你就满校园找你。疫情没有开学,连这点快乐也没有了。你的微博、朋友圈我都可以背
下来了。我看着你的生活,喜怒哀乐都不为我,但却足以影响我的喜怒哀乐。今天是
我认识你的第600天,希望你开心,你知道乌鸦为什么像写字台吗?
——来自一位粉丝投稿

这些小文案跟小代码送给你,希望你喜欢( ω )。
一、玫瑰+文案
明明早已百无禁忌,偏偏你是一百零一。
跟你在一起的时光都
很耀眼
因为天气好
因为天气不好
因为天气刚刚好
每一天,都很美好。
——《鬼怪》
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()
pu()
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)
二、接收我的爱+文案
月亮照回湖心,野鹤奔向闲云,我步入你。
——仓央嘉措
1)效果展示

2)代码展示
import turtle
str = input('请输入表白语:')
turtle.speed(10)#画笔速度
turtle.setup(1800,700,70,70)
turtle.color('black', 'pink')# 画笔颜色
turtle.pensize(3) # 画笔粗细
turtle.hideturtle() # 隐藏画笔(先)
turtle.up() # 提笔
turtle.goto(-655, -255) # 移动画笔到指定起始坐标(窗口中心为0,0)
turtle.down() #下笔
turtle.showturtle() #显示画笔
#画左边的小人
turtle.goto(-600,-200)
turtle.goto(-600,-120)
turtle.circle(35)
turtle.goto(-600,-200)
turtle.forward(40)
turtle.right(90)
turtle.forward(60)
turtle.hideturtle()
turtle.up()
turtle.goto(-600, -160)
turtle.down()
turtle.showturtle()
turtle.left(90)
turtle.forward(55)
turtle.right(45)
turtle.forward(20)
turtle.hideturtle()
turtle.up()
turtle.goto(-600, -145)
turtle.down()
turtle.showturtle()
turtle.goto(-545, -145)
turtle.left(90)
turtle.forward(20)
#画第一个爱心
turtle.color('pink', 'pink')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-500, -153)
turtle.down()
turtle.showturtle()
turtle.right(90)
turtle.forward(30)
turtle.left(90)
turtle.forward(30)
turtle.left(45)
turtle.circle(10.6,180)
turtle.left(180)
turtle.circle(10.6,180)
turtle.end_fill()
#下一个大爱心
turtle.color('green', 'green')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-430, -143)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(45)
turtle.circle(17.67,180)
turtle.left(180)
turtle.circle(17.67,180)
turtle.end_fill()
#第三个爱心
turtle.color('red', 'red')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-315, -133)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(70)
turtle.left(90)
turtle.forward(70)
turtle.left(45)
turtle.circle(24.74,180)
turtle.left(180)
turtle.circle(24.74,180)
turtle.end_fill()
#第四个爱心
turtle.color('red', 'red')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-187, -133)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(70)
turtle.left(90)
turtle.forward(70)
turtle.left(45)
turtle.circle(24.74,180)
turtle.left(180)
turtle.circle(24.74,180)
turtle.end_fill()
#第5个爱心
turtle.color('green', 'green')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(-43.7, -143)
turtle.down()
turtle.showturtle()
turtle.left(135)
turtle.right(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(50)
turtle.left(45)
turtle.circle(17.67,180)
turtle.left(180)
turtle.circle(17.67,180)
turtle.end_fill()
#第6个爱心
turtle.color('pink', 'pink')
turtle.begin_fill()
turtle.hideturtle()
turtle.up()
turtle.goto(53.88, -153)
turtle.down()
turtle.showturtle()
turtle.right(90)
turtle.right(225)
turtle.forward(30)
turtle.left(90)
turtle.forward(30)
turtle.left(45)
turtle.circle(10.6,180)
turtle.left(180)
turtle.circle(10.6,180)
turtle.end_fill()
#画右边的小人
turtle.hideturtle()
turtle.up()
turtle.goto(251.28, -255)
turtle.down()
turtle.showturtle()
turtle.goto(196.28,-200)
turtle.goto(196.28,-120)
turtle.left(90)
turtle.circle(35)
turtle.goto(196.28,-200)
turtle.left(180)
turtle.forward(40)
turtle.left(90)
turtle.forward(60)
turtle.hideturtle()
turtle.up()
turtle.goto(196.28,-160)
turtle.down()
turtle.showturtle()
turtle.right(90)
turtle.forward(55)
turtle.left(45)
turtle.forward(20)
turtle.hideturtle()
turtle.up()
turtle.goto(196.28, -145)
turtle.down()
turtle.showturtle()
turtle.right(45)
turtle.forward(55)
turtle.right(45)
turtle.forward(20)
#画气球线和气球
#第一个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-265, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-245, 0)
turtle.right(135)
turtle.circle(35)
#第2个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-265, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-305, 80)
turtle.circle(40)
#第3个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-137, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-167, 0)
turtle.circle(35)
#第4一个气球
turtle.hideturtle()
turtle.up()
turtle.goto(-137, -133)
turtle.down()
turtle.showturtle()
turtle.goto(-117, 80)
turtle.circle(40)
#写字LOVE
turtle.pencolor("GREEN")
turtle.penup()
turtle.goto(-245,10)
turtle.write("人",move=False,align='center',font=("微软雅黑",30,'normal'))
turtle.pencolor("PURPLE")
turtle.penup()
turtle.goto(-305,90)
turtle.write("间",move=False,align='center',font=("微软雅黑",30,'normal'))
turtle.pencolor("YELLOW")
turtle.penup()
turtle.goto(-167,10)
turtle.write("清",move=False,align='center',font=("微软雅黑",30,'normal'))
turtle.pencolor("ORANGE")
turtle.penup()
turtle.write("欢",move=False,align='center',font=("微软雅黑",30,'normal'))
#写送给谁
turtle.pencolor("black")
turtle.penup()
turtle.goto(300, 200)
turtle.write(str,move=False,align='center',font=("方正舒体",30,'normal'))
turtle.done()三、树+文案
为你,千千万万遍。
——追风筝的人
1)效果展示

2)代码展示
import pygame
import random
import time
import turtle
import multiprocessing
def music_play():
pygame.mixer.init()
while True:
music_name = str(random.randint(1, 3)) + '.mp3'
pygame.mixer.music.load('./music/%s' % music_name)
pygame.mixer.music.play(start=1.0)
time.sleep(120)
pygame.mixer.music.stop()
def draw_arc(lv):
for i in range(20):
lv.right(10)
lv.forward(2)
def draw_love(x, y):
love = turtle.Turtle()
love.hideturtle()
love.up()
love.goto(x, y)
love.color('pink', 'red')
love.speed(10000000)
love.pensize(2)
love.down()
love.begin_fill()
love.left(140)
love.forward(22)
draw_arc(love)
love.left(120)
draw_arc(love)
love.forward(22)
love.left(140)
love.end_fill()
def draw_tree(branchLen, tur):
if branchLen > 5:
if branchLen < 20:
tur.color('green')
tur.pensize(random.uniform((branchLen+5)/4-2, (branchLen+6)/4+5))
tur.down()
tur.forward(branchLen)
draw_love(tur.xcor(), tur.ycor())
tur.up()
tur.backward(branchLen)
tur.color('brown')
return
tur.pensize(random.uniform((branchLen+5)/4-2, (branchLen+6)/4+5))
tur.down()
tur.forward(branchLen)
angle = random.uniform(15, 45)
tur.right(angle)
draw_tree(branchLen-random.uniform(12, 16), tur)
tur.left(2*angle)
draw_tree(branchLen-random.uniform(12, 16), tur)
tur.right(angle)
tur.up()
tur.backward(branchLen)
def draw_main():
Win = turtle
tur = turtle.Turtle()
tur.hideturtle()
tur.speed(1000)
tur.left(90)
tur.up()
tur.backward(200)
tur.down()
tur.color("brown")
tur.pensize(32)
tur.forward(60)
draw_tree(100, tur)
Win.exitonclick()
if __name__ == '__main__':
process1 = multiprocessing.Process(target=draw_main)
process2 = multiprocessing.Process(target=music_play)
process1.start()
process2.start()总结
“你是年少的欢喜
这句话反过来也是你 ”——是你
好啦!这篇文章写到这里就正式结束啦。如果各位喜欢的话,请大家帮忙三联啦~,=
这个目前对小编来说很重要。祝各位,发大财,行大运,身体健康。嘻嘻,老规矩源码找我拿撒
关注小编获取更多精彩内容!记得点击传送门哈
如需打包好的完整源码+素材免费分享滴~找我就可以啦!!传送门

边栏推荐
- Why many new websites are not included by search engines
- Before we learn about high-performance computing, let's take a look at its history
- 基于CenterOS7安装Redis及常见问题解决(带图讲解)
- Fiddler simulates low-speed network environment
- LabVIEW uses the visa read function to read USB interrupt data
- vtk. VTP download in JS
- Lambda 学习记录
- OpenResty安装
- 关于优化API接口响应速度
- LeetCode 501 :二叉搜索樹中的眾數
猜你喜欢

LabVIEW获取Clamp函数找到的所有点的信息

It is known that the transverse grain pressure resistance of a certain wood obeys n (x, D2). Now ten specimens are tested for transverse grain pressure resistance, and the data are as follows: (unit:

Expandable to Max – MCU and MPU development, using the same license

干货丨MapReduce的工作流程是怎样的?

【无标题】

LabVIEW用VISA Read函数来读取USB中断数据

LabVIEW和VDM提取色彩和生成灰度图像

Leetcode 501: mode in binary search tree

Ilruntime hotfix framework installation and breakpoint debugging

LabVIEW change the shape or color of point ROI overlay
随机推荐
Deepin20菜单启动选项后自检到iwlwifi停机
LabVIEW pictures look bright or dark after being cast from 16 bits to 8 bits
LabVIEW和VDM提取色彩和生成灰度图像
It is known that the transverse grain pressure resistance of a certain wood obeys n (x, D2). Now ten specimens are tested for transverse grain pressure resistance, and the data are as follows: (unit:
MySQL table mechanism
How to remove the blank at the top of listview
vtk. VTP download in JS
LabVIEW open other exe programs
Apple CMS collection station source code - building tutorial - attached source code - new source code - development documents
BGP - route map extension (explanation + configuration)
Hyperleger fabric installation
【LaTex】latex VS Code snippets(代码片段)
Serial port missing in Ni Max in LabVIEW
flutter 如何去掉listview顶部空白的问题
Expandable to Max – MCU and MPU development, using the same license
LabVIEW改变Point ROI Overlay的形状或颜色
30 | 怎么重设消费者组位移?
LabVIEW确定控件在显示器坐标系中的位置
LabVIEW and VDM extract color and generate gray image
The shell script of pagoda plan task regularly deletes all files under a directory [record]
