代码雨的正确编写方法 微信爱心雨怎么下?

[更新]
·
·
分类:游戏
3929 阅读

代码雨的正确编写方法

微信爱心雨怎么下?

微信爱心雨怎么下?

事实上,表情雨是微信根据所发送的文字自动生成的,而且要求是特定的某些词。如发送“生日快乐”或英文“happy birthday”就会自动“下蛋糕雨”。
发送“么么哒”自动下“亲吻雨”。
发送“想你了”或“I miss you”自动“下星星雨”。
发送“点个赞”自动“下红心雨”

如何实现c语言程序各颜色数字雨代码?

#includeltstdio.hgt
#includelttime.hgt
#includeltwindows.hgt
typedef struct
{
int x,y
char ch
}STU
STU st[100]
//出现位置
void gotoxy(int x, int y)
{
HANDLE hout
COORD pos
pos.X x
pos.Y y
hout GetStdHandle(STD_OUTPUT_HANDLE)
SetConsoleCursorPosition(hout, pos)
}
/*隐藏光标*/
void show_cursor(int hide)
{
CONSOLE_CURSOR_INFO cciCursor
HANDLE hout
hout GetStdHandle(STD_OUTPUT_HANDLE)
if(GetConsoleCursorInfo(hout, ampcciCursor))
{
hide
SetConsoleCursorInfo(hout, ampcciCursor)
}
}
/*设置颜色*/
void set_color(int color)
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), color)
}
main()
{
int i,j
show_cursor(0)
srand(time(NULL))
//初始化结构体
for (i0ilt100i )
{
st[i].x rand()
st[i].y rand()
st[i].ch rand()%(49-47) 48
}
while (1)
{
for (i0ilt100i )
{
gotoxy(st[i].x,st[i].y)
set_color(0x2)//最先出现的颜色;
putchar(st[i].ch)
gotoxy(st[i].x,st[i].y-5)
putchar( )
st[i].y
st[i].ch rand()%(49-47) 48
if (st[i].y-5gt18)
{
gotoxy(st[i].x,st[i].y-1)
putchar( )
gotoxy(st[i].x,st[i].y-2)
putchar( )
gotoxy(st[i].x,st[i].y-3)
putchar( )
gotoxy(st[i].x,st[i].y-4)
putchar( )
gotoxy(st[i].x,st[i].y-4)
putchar( )
}
if (st[i].y gt 23)
{
st[i].x rand()
st[i].y rand()
}
gotoxy(st[i].x,st[i].y)
set_color(0xA)//由前一个颜色渐变成的颜色
putchar(st[i].ch)
}
Sleep(120)
}
}
color(0) printf(