#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<dos.h>
#include<time.h>
#include<bios.h>
#include<stdlib.h>
char zhsz[100][15],csddcsz[15],cszfsddydz[15],jlzf,*score="Score:";
int cgrsh=0,szhh=1,lhxb=1,ccgs=0,szfzdszh,zd=0,szzwz,szfzdszl,p=2,lh[100],zlh=1,shcs=0,fs=0;
wcbk()
{
int thh,tlh;
textbackground(BLUE);
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<=24;thh++)
{
gotoxy(tlh,thh);
putch(’\\263’);
gotoxy(tlh+78,thh);
putch(’\\263’);
}
thh=25;
gotoxy(tlh,thh);
putch(’\\300’);
for(tlh=2;tlh<=76;tlh++)
{
gotoxy(tlh,thh);
putch(’\\304’);
}
gotoxy(tlh,thh);
putch(’\\276’);
textcolor(GREEN);
}
clr(int hh,int llh)
{
char *qc=" ";
int hclh;
if(cgrsh) {gotoxy(2,23);cputs(" ");}
hh=hh-1;
while(hh>=1)
{
hclh=lh[llh];
gotoxy(hclh,hh);
cputs(qc);
llh++;
hh--;
}
}
ts()
{
if(zd&&(cszfsddydz[p]==jlzf))
{
csddcsz[p]=jlzf;
p=p+1;
csddcsz[p]=0;
bs();
jlzf=’ ’;
}
}
zgyt(int hh)
{
int sj=0;
char stop;
if(zd){bs();}
if(szfzdszh==23)
{
if(fs>=5)
{
fs=fs-5;
gotoxy(39,2);
textbackground(6);
textcolor(YELLOW);
cprintf("%3d",fs);
textbackground(BLUE);
}
qc();
}
sj=clock();
while(clock()<=sj+16)
{
if(kbhit())
{ jlzf=bioskey(0);ts();}
}
if(zd) szfzdszh=szfzdszh+1;
xs(hh);
if(jlzf==49) stop=getch();
if(jlzf!=’ ’&&!zd) ss(hh);
if(jlzf==27) exit(1);
if(zd&&(cszfsddydz[p]==jlzf))
{
csddcsz[p]=jlzf;
p=p+1;
csddcsz[p]=0;
}
jlzf=’ ’;
}
qc()
{
int i;
zd=0;
p=2;
for(i=1;i<=14;i++)
{
csddcsz[i]=’ ’;
cszfsddydz[i]=’ ’;
}
csddcsz[i]=0;
cszfsddydz[i]=0;
}
qdc()
{
int lh=1,hh=1;
char ch;
FILE *fp;
fp=fopen("e:\\\\fcp.txt","r");
ch=fgetc(fp);
[NextPage]
while(ch!=EOF)
{
if(ch!=’ ’)
{
zhsz[hh][lh]=ch;
lh=lh+1;
}
else
{
zhsz[hh][lh]=0;
hh=hh+1;
lh=1;
}
ch=fgetc(fp);
}
zhsz[hh][lh]=0;
shcs=hh+20;
}
ss(int hh)
{
int slszhh,slszlh,i=1,j=1,t=2;
slszhh=szhh;
slszlh=zlh;
if(cgrsh) hh--;
for(i=1;i<=20;i++)
{
if(jlzf==zhsz[slszhh][1])
{
szzwz=slszhh;
szfzdszl=lh[slszlh];
szfzdszh=hh-i+1;
zd=1;
csddcsz[1]=zhsz[slszhh][1];
csddcsz[t]=0;
while(zhsz[slszhh][j]!=0)
{
cszfsddydz[j]=zhsz[slszhh][j];
j++;
}
cszfsddydz[j]=0;
break;
}
slszlh=slszlh+1;
slszhh=slszhh+1;
}
}
xs(int xszfcs)
{
int hclhxb,lszhh,szlh=1,llh;
lszhh=szhh;
hclhxb=zlh;
textcolor(WHITE);
lh[lhxb]=random(40);
if(lh[lhxb]==1) lh[lhxb]=lh[lhxb]+3;
lhxb=lhxb+1;
if(cgrsh) xszfcs=xszfcs-1;
clr(xszfcs,zlh);
while(xszfcs>=4)
{
llh=lh[hclhxb];
while(zhsz[lszhh][szlh]!=0)
{
if(kbhit()&&zd) ts();
gotoxy(llh,xszfcs);
putch(zhsz[lszhh][szlh]);
llh++;
szlh++;
}
xszfcs=xszfcs-1;
szlh=1;
hclhxb=hclhxb+1;
lszhh=lszhh+1;
}
}
bs()
{
int hclh,hchh,i=1,xd=1;
hchh=szfzdszh;
hclh=szfzdszl;
textcolor(GREEN);
while(csddcsz[i]!=0)
{
gotoxy(hclh++,hchh);
putch(csddcsz[i]);
i++;
}
textcolor(WHITE);
for(i=1;cszfsddydz[i]!=0;i++)
{
if(csddcsz[i]!=cszfsddydz[i]) xd=0;
}
if(xd)
{
fs=fs+10;
jtcx(hchh);
gotoxy(39,2);
textbackground(6);
textcolor(YELLOW);
cprintf("%3d",fs);
textbackground(BLUE);
qc();
}
}
jtcx(int hh)
{
char qch[]=" ";
int jtcxh,jtcxl,i;
jtcxl=szfzdszl;
szfzdszl=szfzdszl+p/2-1;
jtcxh=szfzdszh+10;
if(jtcxh>20)
jtcxh=23;
textcolor(RED);
while(jtcxh!=szfzdszh)
{
gotoxy(szfzdszl,jtcxh);
putch(24);
delay(9980000);
gotoxy(szfzdszl,jtcxh);
puts(qch);
jtcxh=jtcxh-1;
}
gotoxy(jtcxl,jtcxh);
puts(qch);
sound(480);
delay(60000);
nosound();
textcolor(WHITE);
for(i=1;i<15;i++)
{ zhsz[szzwz][i]=’ ’;}
zhsz[szzwz][i]=0;
}
main()
{
int hh=4,i;
clrscr();
randomize();
wcbk();
gotoxy(33,2);
textbackground(6);
textcolor(YELLOW);
cputs(score);
gotoxy(39,2);
[NextPage]
cprintf("%3d",fs);
gotoxy(1,25);
cputs(" Esc->Exit Pase->Stop ");
textbackground(BLUE);
qdc();
while(hh<=24&&(shcs>=1))
{
shcs=shcs-1;
if(hh<=23)
{
zgyt(hh);
hh=hh+1;
}
else
{
cgrsh=1;
zlh=zlh+1;
szhh=szhh+1;
ccgs=ccgs+1;
zgyt(hh);
}
}
printf("%d",shcs);
}