This commit is contained in:
Steven Hobs
2026-03-04 17:47:10 +08:00
commit d8ba288e1d
11 changed files with 775 additions and 0 deletions

47
zifuzhen.cpp Normal file
View File

@@ -0,0 +1,47 @@
// 编译环境Visual C++ 6.0~2022EasyX_25.9.10
// https://easyx.cn
//
#include <graphics.h>
#include <time.h>
#include <conio.h>
int main()
{
// 设置随机种子
srand((unsigned) time(NULL));
// 初始化图形模式
initgraph(640, 480);
int x, y;
char c;
settextstyle(16, 8, _T("Courier")); // 设置字体
// 设置颜色
settextcolor(GREEN);
setlinecolor(BLACK);
for (int i = 0; i <= 479; i++)
{
// 在随机位置显示三个随机字母
for (int j = 0; j < 3; j++)
{
x = (rand() % 80) * 8;
y = (rand() % 20) * 24;
c = (rand() % 26) + 65;
outtextxy(x, y, c);
}
// 画线擦掉一个像素行
line(0, i, 639, i);
Sleep(10); // 延时
if (i >= 479) i = -1;
if (_kbhit()) break; // 按任意键退出
}
// 关闭图形模式
closegraph();
return 0;
}