首页 > 分享 > 520表白神器(中文版)

520表白神器(中文版)

最新推荐文章于 2024-06-06 19:38:53 发布

开朗的程序猿 于 2022-05-16 20:39:12 发布

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。

、大家好。

我还四

那过三好鞋生

三好学生

520又到了

大家有woman friend and man friend(作者的英语有点飘)了吗?
没有的扣1

投的扣2

反正我是single body dog(单身狗)

为了脱离single body(单身)

作者扛着被老妈揍的风险

写了个表白神器(为了水文章也是拼了)

请把文章看到最后

否则后果自负

花不多说,上代码:

#include <iostream>

#include <ctime>

#include <cmath>

#include <windows.h>

#include <conio.h>

#define WB "color 70"

#define WR "color 7C"

#define unit "* "

#define ESC 27

#define posHeartX 50

#define posHeartY 5

enum

{

row = 46,

col = 47

};

bool Heart[row * col];

void init(void);

void goto_xy(int x, int y);

void illuminate(void);

void show(void);

int main(void)

{

using std::cin;

using std::cout;

int key = 0;

system(WB);

init();

illuminate();

cin.get();

system(WR);

while ((key = getch()) && (key != ESC))

{

system("cls");

show();

}

cout << "nPress any key to continue.n";

cin.get();

return 0;

}

void init(void)

{

for (int i = 0; i < row; i++)

for (int j = 0; j < col; j++)

Heart[i * col + j] = false;

}

void goto_xy(int x, int y)

{

HANDLE hOut;

hOut = GetStdHandle(STD_OUTPUT_HANDLE);

COORD pos = {x, y};

SetConsoleCursorPosition(hOut, pos);

}

void illuminate(void)

{

using std::cout;

double x, y, leftValue, rightValue;

for (int i = 0; i < row; i++)

{

for (int j = 0; j < col; j++)

{

x = -1.15 + 0.05 * j;

y = +1.25 - 0.05 * i;

leftValue = x * x * y * y * y;

rightValue = pow(x * x + y * y - 1, 3);

if (leftValue >= rightValue)

{

Heart[i * col + j] = true;

goto_xy(0, 0);

cout << "v positive " << leftValue << " >= " << rightValue;

goto_xy(posHeartX + 2 * j, posHeartY + i);

cout << "|";

}

else

{

Heart[i * col + j] = false;

goto_xy(0, 0);

cout << "x negative " << leftValue << " < " << rightValue;

goto_xy(posHeartX + 2 * j, posHeartY + i);

cout << "O";

}

Sleep(7);

}

}

}

void show(void)

{

using std::cout;

int fromWhere;

int x, y;

srand((unsigned int)clock());

do

{

fromWhere = rand() % (row * col);

} while (Heart[fromWhere] == false);

x = fromWhere / col;

y = fromWhere % col;

int Rx, Ry, Rmax;

Rx = x > (row - 1 - x) ? x : (row - 1 - x);

Ry = y > (col - 1 - y) ? y : (col - 1 - y);

Rmax = (int)sqrt(Rx * Rx + Ry * Ry) + 1;

for (int r = 1; r < Rmax; r++)

{

for (int i = 0; i < row; i++)

{

for (int j = 0; j < col; j++)

{

if ((((i - x) * (i - x) + (j - y) * (j - y)) < r * r) && Heart[i * col + j])

{

goto_xy(posHeartX + 2 * j, posHeartY + i);

cout << unit;

}

}

}

Sleep(20);

}

}

运行的结果自己摸索

杠精:作者可真懒,注释都没写。

对于这种键盘侠我只能说

自己体会下被衣架打的体验

毕竟也不能影响学习

(作者的英语就是被Java,Python,C++,html,C#,PHP,易语言,VBScript,js,CSS影响的)

算了不吹牛了

只有Python,C++,html

还有作者不建议大家直接运行exe

在cpp文件里运行比较好

因为如果运行exe你没反应过来打开全屏他就已经打印很多了

这样子你将得到一个不完整的爱心

在cpp文件运行的话

它编译的比较慢(作者只知道DevC++,其它的不知道)

好了以上都是本期内容

谢谢观看

看到这里不妨点赞加关注和收藏

成为我的粉丝拥有专属福利哦

比如明日之后完整版

如果不是的话只能看到零零碎碎的代码

点个关注也行

因为作者比较穷

有些设了VIP才能看

谢谢大家

相关知识

520送花该如何表白
“520”引爆“表白经济”
520放肆爱,爱就大声说
520情人节鲜花表白祝福语
520表白情话文案(精选480句)
适合520表白的文案(精选450句)
玫瑰花一键生成软件(七夕表白神器)
520表白日你对表白攻略做好准备了吗?方案提前已备好只等你来取
520心动礼、促销活动:美团 520表白节 鲜花会场 11朵玫瑰花束68元起~
2018年5月20日适合表白吗?520告白怎么做成功率高一点

网址: 520表白神器(中文版) https://m.huajiangbk.com/newsview832552.html

所属分类:花卉
上一篇: 如何使用C语言制作表白神器
下一篇: 冰冷表白软件生成器(表白神器)