打字练习课程设计分析(4)

2021-09-24 19:34

printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1");

gotoxy(1,2);

printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1");

gotoxy(1,3);

printf("\1\1\1 \1\1\1"); gotoxy(1,4);

printf("\1\1\1 \1\1\1"); gotoxy(1,5);

printf("\1\1\1 \1\1\1"); gotoxy(1,6);

printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1");

gotoxy(1,7);

printf("\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1");

gotoxy(8,4);

printf("Are you sure to exit?(Y/N)"); gotoxy(1,27); key=0;

while(key!='Y' && key!='y' && key!='N' && key!='n') { key=getch(); putchar(key); getch();

if(key=='N' || key=='n') {

textbackground(bgcol[0]); clrscr();

textbackground(bgcol[0]); textcolor(7);

打字练习的课程设计分析以及代码

window(2,3,79,23); gotoxy(x,y); gch[j]=getch(); putchar(gch[j]); if(gch[j]==out[j]) right++;

else wrong++; wrong--; }

if(key=='Y'||key=='y') exit(0); }

goto line; }

if(gch[j]==out[j]) right++; else {

wrong++; sound(140);

delay(90000000); nosound(); } j++;

total=right+wrong; }

end=clock(); }

while((j!=zz)&&(m!=0)); gotoxy(27,20); printf("right:%3.0f wrong:%3.0f usetime:%3.0fS",right,wrong,total,(end-begin)/CLK_TCK); if((fp=fopen("recore.txt","w"))==NULL) {gotoxy(4,18);

printf("cannot open file"); return;}

fscanf(fp,"%c %5.4f",rename,&rerate); if(strcmp(uname,rename)==0)

if(rerate>(right/(right+wrong)))

fprintf(fp,"%c 5.4f%",uname,right/(right+wrong)); else

fprintf(fp,"%c 5.4f%",uname,right/(right+wrong)); fclose(fp);

window(1,1,80,25);

total:%3d

打字练习的课程设计分析以及代码

}

/*输入名字,模式,字数*/ void User() {

textbackground(GREEN); textcolor(7);

window(2,3,79,23); clrscr(); gotoxy(2,3);

printf("Please enter your name:"); gotoxy(25,3); gets(uname); gotoxy(2,4);

printf("Instruction:1.(very easy)Only Lowercase."); gotoxy(2,5);

printf(" 2.(easy)Lowercase and Uppercase."); gotoxy(2,6);

printf(" 3.(hard)Mixture with Lowercase,Uppercase,Number and Symbol."); gotoxy(2,7);

printf("Please choose the textmode(1-3):"); gotoxy(34,7); gets(choosec); gotoxy(2,8);

printf("Please enter the count(1-300):"); scanf("%d",&zz); gotoxy(2,9);

printf("The textmode you chooes is:%s",choosec); gotoxy(2,10);

printf("Your name is:"); printf("%s",uname); gotoxy(2,11);

printf("The count you choose is:%d",zz); window(1,1,80,25); }

/*背景颜色*/ void Bgcolor() { bgcol[0]=1;

textbackground(GREEN); textcolor(7);

window(2,3,79,23); clrscr();

打字练习的课程设计分析以及代码

gotoxy(2,3);

printf("Color instruction:"); gotoxy(2,4);

printf(" 0-BLACK"); gotoxy(2,5);

printf(" 1- BLUE"); gotoxy(2,6);

printf(" 2- GREEN"); gotoxy(2,7);

printf(" 3- CYAN"); gotoxy(2,8);

printf(" 4- RED"); gotoxy(2,9);

printf(" 5- MAGENTA"); gotoxy(2,10);

printf(" 6- BROWN"); gotoxy(2,11);

printf(" 7- LIGHTGRAY"); gotoxy(2,12);

printf("Note:Textcolor and textbackground must be different!!!!!"); gotoxy(2,13);

printf("Please enter the textbackground(0-7):"); x=wherex(); y=wherey();

bgcol[0]=getch(); if(bgcol[0]!='\033') putchar(bgcol[0]);

line1: if(bgcol[0]=='\033') {

gotoxy(50,21);

printf("Are you sure exit?(Y/N)"); gotoxy(73,21); key=0;

while(key!='Y' && key!='y' && key!='N' && key!='n') {key=getch(); putchar(key); getch();

if(key=='N' || key=='n') { gotoxy(50,21);


打字练习课程设计分析(4).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:大侠别嚣张之三大阵容强力推荐 制胜法宝

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: