学习c语言的时候编写的英语打字练习软件,已经上传github
自取 https://github.com/lzl12123/typing-software
软件实际效果如下
在下载的压缩包里,运行exe文件就可使用,源码为ConsoleApplication1这个文件

 
 
部分代码如下:
- void welcom()//介绍
 - {
 - int musicopen = 0;//用于判断bgm是否开启的数
 - mciSendString("open .\\新建文件夹\\登录.mp3", NULL, 0, NULL);
 - mciSendString("play .\\新建文件夹\\登录.mp3 ", NULL, 0, NULL);
 - loop://使返回后能够再次显示界面
 - setbkmode(TRANSPARENT);//使背景窗口透明
 - IMAGE img;
 - loadimage(&img, ".\\新建文件夹\\background.jpg");
 - putimage(0, 0, &img);
 - settextcolor(RED);
 - settextstyle(32, 0, "宋体");//设置字体大小和字体样式(字号 风格 字体)
 - outtextxy(200, 250, "欢迎进入该打字软件");
 - settextstyle(32, 0, "华文行楷");
 - outtextxy(750, 40, "输入1~9选择BGM");
 - outtextxy(750, 90, "输入Tab关闭BGM");
 - outtextxy(200, 350, "该软件开发用于练习打字速度,想来玩玩吗来吧!");
 - settextstyle(26, 0, "华文行楷");
 - outtextxy(200, 460, "按enter进入");
 - outtextxy(200, 500, "输入eas退出");
 - char a;
 - int color = 255;
 - settextstyle(26, 0, "华文行楷");
 - while (true)
 - {
 - setcolor(RGB(color, 0, 0));
 - color -= 10;//颜色越来越暗 出现闪烁效果
 - if (color < 0)
 - color = 255;//红色
 - outtextxy(200, 460, "按enter进入");
 - outtextxy(200, 500, "输入eas退出");
 - Sleep(50);
 - if (_kbhit())//有按键
 - {
 - a = _getch();
 - if (a == '\r')
 - {
 - cleardevice();//清屏 准备进入游戏界面
 - mciSendString("close .\\新建文件夹\\登录.mp3 ", NULL, 0, NULL);
 - start();
 - goto loop;
 - }
 - else if (a=='1'||a=='2'||a=='3'||a=='4'||a=='5'||a=='6'||a=='7'||a=='8'||a=='9')//打开bgm
 - {
 - if(musicopen==0)
 - musicopen=backmusic(a);
 - }
 - else if (a == 9)//关闭bgm
 - {
 - if(musicopen==1)
 - musicopen=closemusic();
 - }
 - else if(a==27)//退出
 - {
 - cleardevice();
 - mciSendString("close .\\新建文件夹\\登录.mp3 ", NULL, 0, NULL);
 - return;
 - }
 - }
 - }
 - }
 
使用了eesyx设计了个基本的运行界面。










