45 lines
935 B
C
45 lines
935 B
C
void introcad(int x, int y, char cad[], int a,
|
|
int c, int s, int t, int col) {
|
|
int i;
|
|
for (i=0;i<=a-1;) {
|
|
if (i<a-1){
|
|
cad[i]=getche();
|
|
if (cad[i]==8){
|
|
if (i>0){
|
|
setcolor(col);settextstyle(s,0,t);outtextxy(x,y,cad);
|
|
cad[i-1]=NULL;i-=2;
|
|
}
|
|
else{
|
|
sound(1000);delay(50);nosound();i--;
|
|
}
|
|
}
|
|
setcolor(c);settextstyle(s,0,t);outtextxy(x,y,cad);
|
|
}
|
|
else {
|
|
if (i==a-1 && cad[i]!=13){
|
|
cad[i]=getche();
|
|
if (cad[i]!=13 && cad[i]!=8){
|
|
sound(1000);delay(50);nosound();
|
|
}
|
|
else{
|
|
if (cad[i]==8 && i>=0){
|
|
setcolor(col);settextstyle(s,0,t);outtextxy(x,y,cad);
|
|
cad[i-1]=NULL;i--;
|
|
setcolor(c);settextstyle(s,0,t);outtextxy(x,y,cad);
|
|
}
|
|
}
|
|
i--;
|
|
}
|
|
}
|
|
if (cad[i]==13 && i>0)
|
|
break;
|
|
else
|
|
if (cad[i]==13 && i==0)
|
|
i--;
|
|
if (cad[0]!=NULL)
|
|
i++;
|
|
if (i==-1)
|
|
i++;
|
|
}
|
|
cad[i]=NULL;
|
|
} |