设为首页 加入收藏

TOP

英语打字练习软件-c语言编写
2023-07-23 13:28:14 】 浏览:22
Tags:习软件
?学习c语言的时候编写的英语打字练习软件,已经上传github

自取 https://github.com/grey-wood-wolf/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; } } } } 

使用了easyx设计了个基本的运行界面。

?
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇C/C++ 恨透了 double free or cor.. 下一篇玩转宏定义——从入门到进阶

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目