一个简单的打字练习程序

一个简单的打字练习程序,第1张

一个简单的打字练习程序,第2张

类似学习机上的指法练习程序,简单实用
# include
main()
{
int x,y,I,j;
无符号整数计时器;
char ch;
char key;
char *kb[]={"Q W E R T Y U I O P [ ]",A S D F G H J K L;“,”Z X C V B N M,。/"};
long AllCounter=0,RightCounter=0,false counter = 0;
time _ t t;
int fun _ Esc();
srand((无符号)时间(& t));
clrscr();
gotoxy(18,1);
printf("%s\n ",kb[0]);
gotoxy(20,3);
printf("%s\n ",kb[1]);
gotoxy(22,5);
printf("%s\n ",kb[2]);
gotoxy(11,25);
for(I = 0;I {
printf(" = ");
}
gotoxy(1,1);
printf(" all ch:% LD \ n right:% LD \ n false:% LD ",AllCounter,RightCounter,false counter);
printf(" \ n \ n ");
printf("Esc退出");
printf(" \ n ");
printf("回车暂停");
gotoxy(26,12);
printf(" * * * * * * * * * * * * * ");
gotoxy(26,13);
printf("*按任意键启动!*");
gotoxy(26,14);
printf(" * * * * * * * * * * * * * ");
gotoxy(51,13);
if(getch()= = 27)
{
if(fun _ Esc()= = 1)
{
clrscr();
退出(0);
}
}
gotoxy(23,12);
printf(" ");
gotoxy(23,13);
printf(" ");
gotoxy(23,14);
printf(" ");
lab _ start:
y = 6;
Timer = 100000;
I = rand()% 3;
j = rand()%(12-I);
ch = kb[I][j * 4];
x = 18+I * 2+j * 4;
while(y {
if(kb hit())
{
key = getch();
if(key = = ch | | key = = ch+32)
{
ch = ' * ';定时器= 1000;
}
else if(key = = 27)
{
if(fun _ Esc()= = 1)
{
clrscr();
退出(0);
}
}
else if(key = = ' \ r ')
{
gotoxy(x,y-1);
printf(" ");
gotoxy(28,13);
printf("按任意键继续");
getch();
gotoxy(28,13);
printf(" ");
}
else
{
false counter++;
}
}
if(y > 6)
{
gotoxy(x,y-1);
printf(" ");
}
gotoxy(x,y);
printf("%c ",ch);
gotoxy(1,1);
printf(" all ch:% LD \ n right:% LD \ n false:% LD ",AllCounter,RightCounter,false counter);
延时(定时器);
y++;
}
all counter++;
if(ch = = ' * ')
{
right counter++;
}
转到lab _ start
}
int fun _ Esc()
{
int key = ' # ';
gotoxy(24,12);
printf(" * * * * * * * * * * * * * * * * *);
gotoxy(24,13);
printf("*确定要退出吗?(Y/N)* ";
gotoxy(24,14);
printf(" * * * * * * * * * * * * * * * * *);
gotoxy(51,13);
while(key!='Y' && key!='y' && key!='N' && key!= ' n ')
{
key = getch();
if(key = = ' Y ' | | key = = ' Y ')
{
return 1;
}
if(key = = ' N ' | | key = = ' N ')
{
gotoxy(24,12);
printf(" ");
gotoxy(24,13);
printf(" ");
gotoxy(24,14);
printf(" ");
返回0;
}
}
}

位律师回复
DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
白度搜_经验知识百科全书 » 一个简单的打字练习程序

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情