update lover

This commit is contained in:
floraachy 2025-09-04 10:22:55 +08:00
parent 2fd8956a85
commit 79027390c9
8 changed files with 85 additions and 0 deletions

8
.idea/HelloPython.iml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Python 3.12" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

7
.idea/misc.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Pipenv (pythonProject)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
</project>

8
.idea/modules.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/HelloPython.iml" filepath="$PROJECT_DIR$/.idea/HelloPython.iml" />
</modules>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

26
love.py Normal file
View File

@ -0,0 +1,26 @@
import turtle
# 设置画布和画笔
screen = turtle.Screen()
screen.bgcolor("white")
pen = turtle.Turtle()
pen.color("red")
pen.fillcolor("red")
pen.speed(2)
# 开始绘制爱心
pen.begin_fill()
pen.left(140)
pen.forward(180)
pen.circle(-90, 200)
pen.setheading(60)
pen.circle(-90, 200)
pen.forward(180)
pen.end_fill()
# 隐藏画笔
pen.hideturtle()
# 保持窗口打开
turtle.done()

24
lover.py Normal file
View File

@ -0,0 +1,24 @@
import time
def lover():
target = ""
for char in target.split():
all_char = []
for y in range(12, -12, -1):
lst = []
lst_con = ""
for x in range(-30, 30):
formula = ((x * 0.05) ** 2 + (y * 0.1) ** 2 - 1) ** 3 - (x * 0.05) ** 2 * (y * 0.1) ** 3
if formula <= 0:
lst_con += char[x % len(char)]
else:
lst_con += " "
lst.append(lst_con)
all_char += lst
time.sleep(1)
return "\n".join(all_char)
if __name__ == '__main__':
print(lover())