#include<dos.h>
#include<stdio.h>
#include<conio.h>
xfk()
{
char *zq=" ture",*cu="flase",*fs="score";
int i,j,hh=7;
textcolor(yellow);
gotoxy(3,6);
cputs(zq);
gotoxy(3,11);
cputs(cu);
gotoxy(3,16);
cputs(fs);
textcolor(green);
for(i=1;i<=3;i++)
{
gotoxy(3,hh);
putch('\311');
for(j=4;j<=7;j++)
{
gotoxy(j,hh);
putch('\315');
}
gotoxy(8,hh);
putch('\273');
hh=hh+5;
}
hh=8;
for(i=1;i<=3;i++)
{
gotoxy(3,hh);
putch('\272');
gotoxy(8,hh);
putch('\272');
hh=hh+5;
}
hh=9;
for(i=1;i<=3;i++)
{
gotoxy(3,hh);
putch('\310');
for(j=4;j<=8;j++)
{
gotoxy(j,hh);
putch('\315');
}
gotoxy(8,hh);
putch('\274');
hh=hh+5;
}
textcolor(green);
}
wcbk()
{
int thh,tlh;
textcolor(white);
thh=1;
tlh=1;
gotoxy(tlh,thh);
putch('\332');
for(tlh=2;tlh<=78;tlh++)
{
gotoxy(tlh,thh);
putch('\304');
}
gotoxy(tlh,thh);
putch('\277');
tlh=1;
for(thh=2;thh<=25;thh++)
{
gotoxy(tlh,thh);
putch('\263');
gotoxy(tlh+78,thh);
putch('\263');
}
thh=25;
gotoxy(tlh,thh);
putch('\300');
for(tlh=2;tlh<=78;tlh++)
{
gotoxy(tlh,thh);
putch('\304');
}
gotoxy(tlh,thh);
putch('\276');
textcolor(green);
}
lcbk()
{
int thh,tlh;
textcolor(yellow);
thh=3;
tlh=10;
gotoxy(tlh,thh);
putch('\311');
for(tlh=11;tlh<=70;tlh++)
{
gotoxy(tlh,thh);
putch('\315');
}
gotoxy(tlh,thh);
putch('\273');
tlh=10;
for(thh=4;thh<=22;thh++)
{
gotoxy(tlh,thh);
putch('\272');
gotoxy(tlh+61,thh);
putch('\272');
}
thh=23;
gotoxy(tlh,thh);
putch('\310');
for(tlh=11;tlh<=70;tlh++)
{
gotoxy(tlh,thh);
putch('\315');
}
gotoxy(tlh,thh);
putch('\274');
textcolor(green);
}
zhhs(char lfilename[20])
{
int hh=5,lh=13,i,wz=0,cj=4,bj=1,thh,tlh,zq=0,cu=0,fs=0;
char *zh,lsslzh,filezh;
file *fp;
if(!(fp=fopen(lfilename,"r")))
{printf("cannot open file\n");exit(1);}
while(1)
{
wcbk();
lcbk();
xfk();
for(i=1;i<=6;i++)
{
fread(zh,50,1,fp);
gotoxy(lh,hh);
cputs(zh);
hh=hh+3;
if(feof(fp)) break;
}
fseek(fp,wz,0);
for(hh=6;hh<=21;hh=hh+3)
{
for(lh=13;lh<=62;lh++)
{
bj=1;
gotoxy(lh,hh);
putch(24);
gotoxy(lh,hh);
filezh=fgetc(fp);
wz=wz+1;
if((lsslzh=getch())==27) exit(1);
if((lsslzh==8)&&!(hh==6&&lh==13))
{
bj=0;
if((lh==13)&&(hh!=6))
{
putch(' ');
lh=62;
hh=hh-3;
cj=cj-3;
}
else lh=lh-1;
wz=wz-2;
gotoxy(lh,hh);
putch(' ');
gotoxy(lh,cj);
putch(' ');
gotoxy(lh+1,hh);
putch(' ');
lh=lh-1;
fseek(fp,wz,0);
}
gotoxy(lh,hh);
if(filezh==eof) return(lsslzh);
if(filezh==lsslzh)
{
putch(lsslzh);
fs=fs+5;
zq=zq+1;
gotoxy(4,8);
printf("%2d",zq);
gotoxy(4,18);
printf("%2d",fs);
}
else
{
if(bj)
{
cu=cu+1;
gotoxy(4,13);
printf("%2d",cu);
gotoxy(lh,hh);
textcolor(red);
putch(lsslzh);
gotoxy(lh,cj);
putch(25);
gotoxy(lh,hh);
sound(980);
delay(100000);
nosound();
textcolor(green);
}
}
}
cj=cj+3;
}
delay(2000);
textcolor(yellow);
clrscr();
wz=ftell(fp);
hh=5;
lh=13;
cj=4;
}
}
main()
{
int thh=3,tlh=10;
char zh;
char *filename, *lesson="1.college life\n2.study online\n3.lesiure activity\n4.living on your own";
window(1,1,20,40);
textbackground(blue);
textcolor(yellow);
while(1)
{
clrscr();
printf("%s\n",lesson);
printf("choice lesson number:");
zh=getch();
switch(zh)
{
case 49: filename="e:\\fcp\\college.txt";break;
case 50: filename="e:\\fcp\\study.txt";break;
case 51: filename="e:\\fcp\\lesiure.txt";break;
case 52: filename="e:\\fcp\\living.txt";break;
case 27: exit(1);
default: printf("enter file name:");scanf("%s",filename);
}
clrscr();
zhhs(filename);
clrscr();
printf("continue practic(y\n):");
if(getch()=='n') break;
}
}
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器