printf(" "); gotoxy(x,y);
bgcol[0]=getch(); putchar(bgcol[0]); }
打字练习的课程设计分析以及代码
if(key=='Y'||key=='y') exit(0); } goto line1; }
gotoxy(2,15);
printf("The Textbackground you choose is:%c",bgcol[0]); window(1,1,80,25); }
/*字体颜色*/ void Ccolor() {
ccol[1]=2;
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 textcolor(0-7):"); x=wherex(); y=wherey();
ccol[0]=getch();
打字练习的课程设计分析以及代码
if(ccol[0]!='\033') putchar(ccol[0]);
line1: if(ccol[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);
printf(" "); gotoxy(x,y); ccol[0]=getch(); putchar(ccol[0]); }
if(key=='Y'||key=='y') exit(0); }
goto line1; }
gotoxy(2,15);
printf("The Textcolor you choose is:%c",ccol[0]); window(1,1,80,25); }
/*设时间*/ void Time() {
textbackground(GREEN); textcolor(7);
window(2,3,79,23); clrscr(); gotoxy(1,2);
printf("Please enter the test time:"); scanf("%d",&m); gotoxy(1,3);
printf("The test time you choose is:%3d",m); window(1,1,80,25);