Skip to content

Commit

Permalink
🚀 update
Browse files Browse the repository at this point in the history
  • Loading branch information
sun0225SUN committed Jan 12, 2023
1 parent 60d49c7 commit 87e2663
Show file tree
Hide file tree
Showing 32 changed files with 490 additions and 0 deletions.
37 changes: 37 additions & 0 deletions C/001/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//例20:C语言实现打印出心形,初学者的表白神器

#include<stdio.h>//头文件
int main()//主函数入口
{
printf(" **** ****\n");//打印第一行
printf(" ********* *********\n");//打印第二行
printf("************* *************\n");//打印第三行
int i, j;//定义变量
for (i = 0; i < 3; i++)//打印4-6行,一共3行,因此i小于3
{
for (j = 0; j < 29; j++)//限制每行输出*的个数
{
printf("*");//这三行只打印*号,无空格输出
}
printf("\n");//打印完一行需要进行换行
}
for (i = 0; i < 7; i++) //打印7-13行,一共7行,因此i小于7
{
for (j = 0; j < 2 * (i + 1) - 1; j++)//这个for循环和下面的for是并列的
{
printf(" ");//打印空格
}
for (j = 0; j < 27 - i * 4; j++)//读者可以带入几个数找出条件
{
printf("*");//打印*
}
printf("\n");
}
for (i = 0; i < 14; i++)//打印最后一行的*
{
printf(" ");//打印空格
}
printf("*\n");//打印*
return 0;
}

31 changes: 31 additions & 0 deletions C/002/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#include<stdio.h>
#include<math.h>
int main()
{
float y, x, z;

printf("那一天\n");
printf("第一次遇见你\n");
printf("忘不了\n");
printf("你的容颜\n");
printf("若轻云之蔽月,如流风之回雪\n");
printf("\n\n\n");
printf("其实\n");
printf("有一句话\n");
printf("我一直想对你说:\n");

for (double y = 2.5; y >= -1.6; y = y - 0.2)
{
for (double x = -3; x <= 4.8; x = x + 0.1)
{
(pow((x * x + y * y - 1), 3) <= 3.6 * x * x * y * y * y
|| (x > -2.4 && x < -2.1 && y<1.5 && y>-1)
|| (((x < 2.5 && x>2.2) || (x > 3.4 && x < 3.7)) && y > -1 && y < 1.5)
|| (y > -1 && y < -0.6 && x < 3.7 && x>2.2)) ? printf("*") : printf(" ");
}

printf("\n");
}

getchar();
}
54 changes: 54 additions & 0 deletions C/003/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#include <stdio.h>
#include <math.h>
#include <windows.h>
#include <tchar.h>

float f(float x, float y, float z) {
float a = x * x + 9.0f / 4.0f * y * y + z * z - 1;
return a * a * a - x * x * z * z * z - 9.0f / 80.0f * y * y * z * z * z;
}

float h(float x, float z) {
for (float y = 1.0f; y >= 0.0f; y -= 0.001f)
if (f(x, y, z) <= 0.0f)
return y;
return 0.0f;
}

int main() {
HANDLE o = GetStdHandle(STD_OUTPUT_HANDLE);
_TCHAR buffer[25][80] = { _T(' ') };
_TCHAR ramp[] = _T(".:-=+*#%@");

for (float t = 0.0f;; t += 0.1f) {
int sy = 0;
float s = sinf(t);
float a = s * s * s * s * 0.2f;
for (float z = 1.3f; z > -1.2f; z -= 0.1f) {
_TCHAR* p = &buffer[sy++][0];
float tz = z * (1.2f - a);
for (float x = -1.5f; x < 1.5f; x += 0.05f) {
float tx = x * (1.2f + a);
float v = f(tx, 0.0f, tz);
if (v <= 0.0f) {
float y0 = h(tx, tz);
float ny = 0.01f;
float nx = h(tx + ny, tz) - y0;
float nz = h(tx, tz + ny) - y0;
float nd = 1.0f / sqrtf(nx * nx + ny * ny + nz * nz);
float d = (nx + ny - nz) * nd * 0.5f + 0.5f;
*p++ = ramp[(int)(d * 5.0f)];
}
else
*p++ = ' ';
}
}

for (sy = 0; sy < 25; sy++) {
COORD coord = { 0, sy };
SetConsoleCursorPosition(o, coord);
WriteConsole(o, buffer[sy], 79, NULL, 0);
}
Sleep(33);
}
}
2 changes: 2 additions & 0 deletions C/004/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 考虑到仓库大小,此程序单独存放,请前往
# https://github.com/sun0225SUN/C-Love-Code
2 changes: 2 additions & 0 deletions C/005/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 考虑到仓库大小,此程序单独存放,请前往
# https://github.com/sun0225SUN/C-Meteor-Shower
2 changes: 2 additions & 0 deletions C/006/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 考虑到仓库大小,此程序单独存放,请前往
# https://github.com/sun0225SUN/C-Fireworks-Code
2 changes: 2 additions & 0 deletions Csharp/001/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## 考虑到仓库大小,此程序单独存放,请前往
# https://github.com/sun0225SUN/Be-My-Girlfriend
96 changes: 96 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,55 @@

> 注: 007--009 原文链接:https://zhuanlan.zhihu.com/p/411819722 作者:slandarer
# C

<table >
<!-- 第一行 -->
<tr>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/C/001">
<p align="center">001</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/c/001.png"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/C/002">
<p align="center">002</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/c/002.png"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/C/003">
<p align="center">003</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/imgc/003.png"/>
</a>
</td>
</tr>
<!-- 第二行 -->
<tr>
<td valign="top">
<a href="https://github.com/sun0225SUN/C-Love-Code">
<p align="center">004</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/c/004.png"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/C-Meteor-Shower">
<p align="center">005</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/c/005.png"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/C-Fireworks-Code">
<p align="center">006</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/c/006.png"/>
</a>
</td>
</tr>
</table>

> 004 原作者 https://www.bilibili.com/video/BV13P4y1R7DP/?
# C#

<table align="center">
Expand All @@ -408,3 +457,50 @@
</td>
</tr>
</table>

# Vbs

<table >
<!-- 第一行 -->
<tr>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/Vbs/001">
<p align="center">001</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/matlab/001.gif"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/Vbs/002">
<p align="center">002</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/matlab/002.gif"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/Vbs/003">
<p align="center">003</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/matlab/003.gif"/>
</a>
</td>
</tr>
<!-- 第二行 -->
<tr>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/MatLab/Vbs/004">
<p align="center">004</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/matlab/004.gif"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/Vbs/005">
<p align="center">005</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/vbs/005.gif"/>
</a>
</td>
<td valign="top">
<a href="https://github.com/sun0225SUN/Awesome-Love-Code/tree/main/Vbs/006">
<p align="center">006</p>
<img src="https://cdn.jsdelivr.net/gh/sun0225SUN/Awesome-Love-Code/assets/img/vbs/006.png"/>
</a>
</td>
</tr>
</table>
22 changes: 22 additions & 0 deletions Vbs/001/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

```vbs
msgbox ("我有一件事想跟你说"),vbQuestion,("在吗?")
msgbox ("自从第一天遇见你,我便对你难以忘怀了!")
msgbox ("做我女朋友好吗?")
msgbox ("房产写你名字")
msgbox ("保大")
msgbox ("我妈会游泳")
dim j
do while j<1
Select Case msgbox("做我女朋友好吗?",68,"请郑重的回答我!")
Case 6 j=1
Case 7 msgbox("再给你一次机会")
end Select
loop
msgbox("我就知道你会同意的,哈哈哈哈!!")

```

# 使用教程

https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160
14 changes: 14 additions & 0 deletions Vbs/001/main.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
msgbox ("我有一件事想跟你说"),vbQuestion,("在吗?")
msgbox ("自从第一天遇见你,我便对你难以忘怀了!")
msgbox ("做我女朋友好吗?")
msgbox ("房产写你名字")
msgbox ("保大")
msgbox ("我妈会游泳")
dim j
do while j<1
Select Case msgbox("做我女朋友好吗?",68,"请郑重的回答我!")
Case 6 j=1
Case 7 msgbox("再给你一次机会")
end Select
loop
msgbox("我就知道你会同意的,哈哈哈哈!!")
21 changes: 21 additions & 0 deletions Vbs/002/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
```vbs
msgbox("你不知道,这个代码我早已写好,直到今天才有勇气发给你。请你点击确定,耐心的看完!")
msgbox("曾几何时,我一直以为自己是一艘船。木已成舟,不知何时靠岸?")
msgbox("但自从遇到你,我的罗盘就开始不停地打转。")
msgbox("我在海里徘徊,")
msgbox("我在礁石附近游荡,")
msgbox("最终,我还是搁浅在了你的岸边。")
x=msgbox("我不想再孤独下去,做我女朋友吧!",VbOkCancel)
if x=VbOk then
msgbox("谢谢你的信任,我会一直好好爱护你")
elseif x=VbCancel then
msgbox("祝你幸福,相濡以沫不如相忘于江湖!")
msgbox("电脑将会关机,再见!")
set ws=createobject("wscript.shell")
ws.run"cmd.exe /c shutdown -s -f -t 0"
end if
```

# 使用教程

https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160
15 changes: 15 additions & 0 deletions Vbs/002/main.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
msgbox("你不知道,这个代码我早已写好,直到今天才有勇气发给你。请你点击确定,耐心的看完!")
msgbox("曾几何时,我一直以为自己是一艘船。木已成舟,不知何时靠岸?")
msgbox("但自从遇到你,我的罗盘就开始不停地打转。")
msgbox("我在海里徘徊,")
msgbox("我在礁石附近游荡,")
msgbox("最终,我还是搁浅在了你的岸边。")
x=msgbox("我不想再孤独下去,做我女朋友吧!",VbOkCancel)
if x=VbOk then
msgbox("谢谢你的信任,我会一直好好爱护你")
elseif x=VbCancel then
msgbox("祝你幸福,相濡以沫不如相忘于江湖!")
msgbox("电脑将会关机,再见!")
set ws=createobject("wscript.shell")
ws.run"cmd.exe /c shutdown -s -f -t 0"
end if
26 changes: 26 additions & 0 deletions Vbs/003/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
```vbs
Set Seven = WScript.CreateObject("WScript.Shell")
strDesktop = Seven.SpecialFolders("AllUsersDesktop")
set oShellLink = Seven.CreateShortcut(strDesktop & "\\Seven.url")
oShellLink.Save
se_key = (MsgBox("我喜欢你很久了,你可以做我女朋友吗 是=同意 否=拒绝 ",4,"我没有开玩笑!!!"))
If se_key=6 Then
MsgBox "谢谢你给了我这次机会,I Love You",64,"Love you"
Else
seven.Run "shutdown.exe -s -t 600"
agn=(MsgBox ("我真的很喜欢你!求你了,别拒绝我,好吗?是=同意 否=拒绝",4,"别拒绝我,好吗?"))
If agn=6 Then
seven.Run "shutdown.exe -a"
MsgBox "谢谢你给了我这次机会,I Love You",,"Love you"
WScript.Sleep 500
Else
MsgBox "唉,那祝你能找到自己喜欢的人,若可回头,记住,我在你身后一直等你!--爱你的人",64,"祝你幸福!!"
seven.Run "shutdown.exe -a"
MsgBox "其实你拒绝了我,我也不会关你电脑的!因为你是我最重要的人,我不会捉弄你的!",64,"我愿意等你!"
End If
End If
```

# 使用教程

https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160
20 changes: 20 additions & 0 deletions Vbs/003/main.vbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Set Seven = WScript.CreateObject("WScript.Shell")
strDesktop = Seven.SpecialFolders("AllUsersDesktop")
set oShellLink = Seven.CreateShortcut(strDesktop & "\\Seven.url")
oShellLink.Save
se_key = (MsgBox("我喜欢你很久了,你可以做我女朋友吗 是=同意 否=拒绝 ",4,"我没有开玩笑!!!"))
If se_key=6 Then
MsgBox "谢谢你给了我这次机会,I Love You",64,"Love you"
Else
seven.Run "shutdown.exe -s -t 600"
agn=(MsgBox ("我真的很喜欢你!求你了,别拒绝我,好吗?是=同意 否=拒绝",4,"别拒绝我,好吗?"))
If agn=6 Then
seven.Run "shutdown.exe -a"
MsgBox "谢谢你给了我这次机会,I Love You",,"Love you"
WScript.Sleep 500
Else
MsgBox "唉,那祝你能找到自己喜欢的人,若可回头,记住,我在你身后一直等你!--爱你的人",64,"祝你幸福!!"
seven.Run "shutdown.exe -a"
MsgBox "其实你拒绝了我,我也不会关你电脑的!因为你是我最重要的人,我不会捉弄你的!",64,"我愿意等你!"
End If
End If
17 changes: 17 additions & 0 deletions Vbs/004/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```vbs
const title = "爱情测试"
const yourname = "王冰冰"
const question = "你最喜欢的人是谁?请在下面的方框中输入他(她)的名字。"
const info = "你在说谎!不要逃避,实话实说。"
const scend = "你说出了你的心扉,那就向他(她)表白吧。"
dim youranswer
do
youranswer = inputbox(question, title)
if youranswer <> yourname then msgbox info, vbinformation+vbokonly, title
loop until youranswer = yourname
msgbox scend, vbinformation+vbokonly, title
```

# 使用教程

https://blog.csdn.net/weixin_50915462/article/details/113805008#vbs_160
Loading

0 comments on commit 87e2663

Please sign in to comment.