#include #include #include #include void main(void) { clrscr(); int left=2; int right=79; int top=2; int bottom=49; int snd1,snd2,snd3,snd4; snd1=100; snd2=200; snd3=300; snd4=400; while(!kbhit()) { for(int i=left; i<=right; i++) { delay(10); sound(snd1); if(i>20 && i<79) { gotoxy(i,top); textcolor(GREEN); cprintf("%c",char(3)); } else { gotoxy(i,top); textcolor(WHITE); cprintf("%c",char(3)); } }nosound(); for(i=top; i<=bottom; i++) { delay(10); sound(snd2); gotoxy(right,i); textcolor(GREEN); cprintf("%c",char(3)); }nosound(); for(i=right; i>=left; i--) { delay(10); sound(snd3); if(i<79 && i>20) { gotoxy(i,bottom); textcolor(GREEN); cprintf("%c",char(3)); } else { gotoxy(i,bottom); textcolor(WHITE); cprintf("%c",char(3)); } }nosound(); for(i=bottom; i>=top; i--) { delay(10); sound(snd4); if(top>=21 && bottom <= 30) { gotoxy(left,i); textcolor(GREEN); cprintf("%c",char(3)); } else { gotoxy(left,i); textcolor(WHITE); cprintf("%c",char(3)); } gotoxy(79,49); textcolor(GREEN); cprintf("%c",char(3)); } nosound(); left++; right--; bottom--; top++; snd1+=50,snd2+=50,snd3+=50,snd4+=50; if(left>=26) break; } for(int row=5; row<=20; row++) { delay(70); gotoxy(25,row); textcolor(RED); cprintf("***"); } for(int col=25; col<=30; col++) { delay(70); gotoxy(col,5); textcolor(RED); cprintf("***"); gotoxy(col,6); textcolor(RED); cprintf("***"); gotoxy(col,14); textcolor(RED); cprintf("***"); gotoxy(col,15); textcolor(RED); cprintf("***"); } for(row=7; row<=13; row++) { delay(70); gotoxy(33,row); textcolor(RED); cprintf("**"); } float colm=40; for(row=20; row>=5; row--) { delay(70); gotoxy(colm=colm+.4,row); textcolor(RED); cprintf("***"); } colm=colm-.4; for(row=5; row<=20; row++) { delay(70); gotoxy(colm=colm+.4,row); textcolor(RED); cprintf("***"); } for(col=42; col<=47; col++) { delay(70); gotoxy(col,14); textcolor(RED); cprintf("***"); gotoxy(col,15); textcolor(RED); cprintf("***"); } for(row=5; row<=20; row++) { delay(70); gotoxy(61,row); textcolor(RED); cprintf("***"); } col=61; for(row=14; row>=5; row--) { delay(70); gotoxy(col+=1,row); textcolor(RED); cprintf("***"); } col=61; for(row=12; row<=20; row++) { delay(70); gotoxy(col+=1,row); textcolor(RED); cprintf("***"); } for(row=35; row<=45; row++) { delay(70); gotoxy(25,row); textcolor(MAGENTA); cprintf("**"); gotoxy(30,row); textcolor(MAGENTA); cprintf("**"); } for(col=25; col<=30; col++) { delay(70); gotoxy(col,35); textcolor(MAGENTA); cprintf("**"); gotoxy(col,45); textcolor(MAGENTA); cprintf("**"); } for(col=35; col<=40; col++) { delay(70); gotoxy(col,35); textcolor(MAGENTA); cprintf("**"); gotoxy(col,45); textcolor(MAGENTA); cprintf("**"); } float rowm=45; for(row=35;row<=39; row++) { delay(70); gotoxy(35,row); textcolor(MAGENTA); cprintf("**"); gotoxy(40,--rowm); textcolor(MAGENTA); cprintf("**"); } for(col=35; col<=40; col++) { delay(70); textcolor(MAGENTA); gotoxy(col,39); cprintf("**"); textcolor(MAGENTA); gotoxy(col,40); cprintf("**"); } rowm=45; for(row=35; row<=36; row++) { delay(70); textcolor(MAGENTA); gotoxy(40,row); cprintf("**"); gotoxy(35,rowm--); cprintf("**"); } for(row=35; row<=45; row++) { delay(70); textcolor(MAGENTA); gotoxy(45,row); cprintf("**"); textcolor(MAGENTA); gotoxy(54,row); cprintf("**"); } colm=46; float col1=53; for(row=36; row<=39; row++) { delay(70); gotoxy(colm++,row); cprintf("**"); gotoxy(col1--,row); cprintf("**"); } gotoxy(50,40); textcolor(MAGENTA); cprintf("*"); for(row=45; row>=35; row--) { delay(70); gotoxy(59,row); textcolor(MAGENTA); cprintf("**"); gotoxy(65,row); textcolor(MAGENTA); cprintf("**"); } for(col=59; col<=65; col++) { delay(70); gotoxy(col,35); textcolor(MAGENTA); cprintf("**"); gotoxy(col,36); textcolor(MAGENTA); cprintf("**"); gotoxy(col,39); textcolor(MAGENTA); cprintf("**"); gotoxy(col,40); textcolor(MAGENTA); cprintf("**"); } colm=70; rowm=35; for(row=45; row>=35; row--) { delay(70); gotoxy(70,row); textcolor(MAGENTA); cprintf("**"); gotoxy(77,row); textcolor(MAGENTA); cprintf("**"); gotoxy(colm+=.7,rowm++); textcolor(MAGENTA); cprintf("**"); } while(!kbhit()) { for(int i=right; i>left; i--) { delay(10); sound(snd1); if(i>20 && i<79) { gotoxy(i,top); textcolor(BLACK); cprintf("*"); } else { gotoxy(i,top); textcolor(BLACK); cprintf("*"); } }nosound(); for(i=bottom; i>top; i--) { delay(10); sound(snd2); gotoxy(right,i); textcolor(BLACK); cprintf("*"); }nosound(); for(i=left; i< right; i++) { delay(10); sound(snd3); if(i<79 && i>20) { gotoxy(i,bottom); textcolor(BLACK); cprintf("*"); } else { gotoxy(i,bottom); textcolor(BLACK); cprintf("*"); } }nosound(); for(i=top; i=21 && bottom <= 30) { gotoxy(left,i); textcolor(BLACK); cprintf("*"); } else { gotoxy(left,i); textcolor(BLACK); cprintf("*"); } gotoxy(79,49); textcolor(BLACK); cprintf("*"); } nosound(); left--; right++; bottom++; top--; snd1-=50,snd2-=50,snd3-=50,snd4-=50; if(left<=1) break; } getch(); }