#include #include #include #include void color(void); void name(void); void board(void); void menutri(void); void menu(void); void about(void); void level(void); void start(void); void check(void); void win(void); void lose(void); void good(void); void fair(void); void cred(void); void quit(void); void box(void); void esc(void); int i,j,lev,tim,colr,mist=0,flag=0; int r[55],ipp[45]; char ch; /*****/ void main(void) { clrscr(); _setcursortype(_NOCURSOR); name(); delay(900); board(); menutri(); menu(); } /*****/ void name(void) { textcolor(7); // A for(i=15;i>=12;i--) { gotoxy(35,i); cprintf("0 0"); delay(100); } gotoxy(35,11); cprintf(" 0 0 "); delay(100); gotoxy(35,10); cprintf(" 0 0"); delay(100); gotoxy(35,9); cprintf(" 00"); delay(100); for(i=37;i<=40;i++) { gotoxy(i,13); cprintf("0"); delay(100); } sound(1500); delay(100); nosound(); delay(60); // Z I textcolor(3); for(i=2,j=23;i<=9,j>=16;i++,j--) { gotoxy(25,i-1); clreol(); gotoxy(45,j); clreol(); gotoxy(27,i); cprintf(" "); gotoxy(26,i); cprintf("0000000"); gotoxy(45,j-1); cprintf(" "); gotoxy(45,j-1); cprintf("000"); gotoxy(27,i+1); cprintf(" "); gotoxy(26,i+1); cprintf(" 0 "); gotoxy(45,j-2); cprintf(" "); gotoxy(45,j-2); cprintf(" 0 "); gotoxy(27,i+2); cprintf(" "); gotoxy(26,i+2); cprintf(" 0 "); gotoxy(45,j-3); cprintf(" "); gotoxy(45,j-3); cprintf(" 0 "); gotoxy(27,i+3); cprintf(" "); gotoxy(26,i+3); cprintf(" 0 "); gotoxy(45,j-4); cprintf(" "); gotoxy(45,j-4); cprintf(" 0 "); gotoxy(27,i+4); cprintf(" "); gotoxy(26,i+4); cprintf(" 0 "); gotoxy(45,j-5); cprintf(" "); gotoxy(45,j-5); cprintf(" 0 "); gotoxy(27,i+5); cprintf(" "); gotoxy(26,i+5); cprintf(" 0 "); gotoxy(45,j-6); cprintf(" "); gotoxy(45,j-6); cprintf(" 0 "); gotoxy(27,i+6); cprintf(" "); gotoxy(26,i+6); cprintf("0000000"); gotoxy(45,j-7); cprintf(" "); gotoxy(45,j-7); cprintf("000"); delay(130); } sound(1500); delay(100); nosound(); // U textcolor(6); for(i=1;i<=17;i++) { gotoxy(i,9); cprintf("0 0"); gotoxy(i,10); cprintf("0 0"); gotoxy(i,11); cprintf("0 0"); gotoxy(i,12); cprintf("0 0"); gotoxy(i,13); cprintf("0 0"); gotoxy(i,14); cprintf("0 0"); gotoxy(i,15); cprintf("00000000"); delay(60); } sound(1500); delay(100); nosound(); for(i=1;i<=16;i++) { gotoxy(i,9); cprintf(" "); gotoxy(i,10); cprintf(" "); gotoxy(i,11); cprintf(" "); gotoxy(i,12); cprintf(" "); gotoxy(i,13); cprintf(" "); gotoxy(i,14); cprintf(" "); gotoxy(i,15); cprintf(" "); delay(60); } sound(1500); delay(100); nosound(); // R for(i=72;i>=50;i--) { gotoxy(i,9); cprintf("00000"); gotoxy(i,10); cprintf("0 0"); gotoxy(i,11); cprintf("0 0"); gotoxy(i,12); cprintf("00000"); gotoxy(i,13); cprintf("0 0"); gotoxy(i,14); cprintf("0 0"); gotoxy(i,15); cprintf("0 0"); delay(50); } sound(1500); delay(100); nosound(); for(i=78;i>=54;i--) { gotoxy(i+1,9); cprintf(" "); gotoxy(i+2,10); cprintf(" "); gotoxy(i+2,11); cprintf(" "); gotoxy(i+1,12); cprintf(" "); gotoxy(i,13); cprintf(" "); gotoxy(i+1,14); cprintf(" "); gotoxy(i+2,15); cprintf(" "); delay(60); } sound(1500); delay(100); nosound(); textcolor(2); gotoxy(28,23); cprintf("Proudly"); sound(500); delay(150); nosound(); delay(300); gotoxy(37,23); cprintf("Presents"); sound(1000); delay(150); nosound(); delay(500); delay(200); textcolor(5); gotoxy(17,12); cprintf("# # # # # # #####"); delay(150); gotoxy(17,10); cprintf("# # # # # # # #"); delay(150); gotoxy(17,14); cprintf("# # # # # # # #"); delay(150); gotoxy(17,9); cprintf("# # ####### ## ### #####"); delay(150); gotoxy(17,15); cprintf("######## ####### # # ### # #"); delay(150); gotoxy(17,11); cprintf("# # # # # # # #"); delay(150); gotoxy(17,13); cprintf("# # # # **** # # # #"); delay(150); } /*****/ void board(void) { clrscr(); textcolor(14); gotoxy(23,2); cprintf("\" M A G I C A L T R I A N G L E \""); } /*****/ void menutri(void) { int a,b,c; textcolor(9); b=80; c=24; for(a=1;a<=40;a+=2) { for(i=a;i<=b;i++) { gotoxy(i,c); cputs("0"); } delay(15); b-=2; c--; sound((a+8)*100); delay(15); nosound(); } } /*****/ void menu(void) { textcolor(5); gotoxy(29,7); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); for(i=8;i<=21;i++) { gotoxy(29,i); cprintf("º º"); delay(30); } gotoxy(29,22); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); textcolor(13); gotoxy(31,8); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); for(i=9;i<=20;i++) { gotoxy(31,i); cprintf("º º"); delay(30); } gotoxy(31,21); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); /***** Menu *****/ gotoxy(39,9); cprintf("MENU"); textcolor(10);gotoxy(35,11);cprintf("S"); textcolor(2);gotoxy(36,11);cprintf("tart"); sound(1000);delay(80);nosound(); textcolor(10);gotoxy(35,13);cprintf("L"); textcolor(2);gotoxy(36,13);cprintf("evel"); sound(1000);delay(80);nosound(); textcolor(10);gotoxy(35,15);cprintf("A"); textcolor(2);gotoxy(36,15);cprintf("bout Game"); sound(1000);delay(80);nosound(); textcolor(10);gotoxy(35,17);cprintf("C"); textcolor(2);gotoxy(36,17);cprintf("redit"); sound(1000);delay(80);nosound(); textcolor(10);gotoxy(35,19);cprintf("Q"); textcolor(2);gotoxy(36,19);cprintf("uit"); sound(1000);delay(80);nosound(); /***** Input Choice *****/ do { ch=getch(); } while ( !(ch=='s' || ch=='l' || ch=='a' || ch=='c' || ch=='q') ); switch (ch) { case 's': start(); break; case 'l': level(); break; case 'a': about(); break; case 'c': cred(); break; case 'q': quit(); break; default: break; } } /*****/ void about(void) { clrscr(); colr=8; box(); textcolor(2); gotoxy(34,5); cprintf("ABOUT GAME"); textcolor(3); gotoxy(6,9); cprintf(" The name of this game is \"MAGIC TRIANGLE\".In this game computer"); gotoxy(6,10); cprintf("will print some numbers on the screen and they disappear in few seconds."); gotoxy(6,11); cprintf("You have to reprint those numbers. The quntity of numbers increase with "); gotoxy(6,12); cprintf("the increase in level.You have 5 levels from 1 to 5.You have to select "); gotoxy(6,13); cprintf("level before starting the game.If you end without any mistake you win, "); gotoxy(6,14); cprintf("otherwise your result will be good or fair.You can do 5,7,10,14,19,25 "); gotoxy(6,15); cprintf("mistakes in 1,2,3,4,5 levels respectively.If your mistakes exceed from "); gotoxy(6,16); cprintf("these no.s you will loose the game."); gotoxy(6,21); cprintf("Thanks for playing my game.................................UZAIR AHMAD."); getch(); clrscr(); board(); menutri(); menu(); } /*****/ void cred(void) { clrscr(); colr=6; box(); textcolor(2); gotoxy(36,4); cprintf("CREDIT."); textcolor(3); gotoxy(10,8); cprintf("Programmed by "); textcolor(6);cprintf(":"); textcolor(13); gotoxy(32,8); cprintf("Uzair Ahmad"); delay(80); textcolor(3); gotoxy(10,10);cprintf("Language "); textcolor(6);cprintf(":"); textcolor(13); gotoxy(32,10); cprintf("Turbo C++"); delay(80); textcolor(3); gotoxy(10,12);cprintf("Date "); textcolor(6);cprintf(":"); textcolor(13); gotoxy(32,12);cprintf("12th July 1998"); delay(80); textcolor(3); gotoxy(10,14);cprintf("Inspected By "); textcolor(6);cprintf(":"); textcolor(13); gotoxy(32,14);cprintf("Umair Ahmad"); delay(80); textcolor(3); gotoxy(10,16);cprintf("Last Modefied "); textcolor(6);cprintf(":"); textcolor(13); gotoxy(32,16);cprintf("18th July 1998"); delay(80); getch(); clrscr(); board(); menutri(); menu(); } /*****/ void level(void) { mist=0; clrscr(); board(); do { textcolor(13); gotoxy(15,10); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); delay(50); for(i=11;i<=16;i++) { gotoxy(15,i); cprintf("º º"); } delay(50); gotoxy(15,17); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); delay(50); sound(2000);delay(100);nosound(); sound(1000);delay(200);nosound(); textcolor(2); gotoxy(22,12); cprintf(" Level Selection "); delay(50); textcolor(9); gotoxy(22,14); cprintf("You can select a level from 1 to 5."); delay(50); gotoxy(22,15); cprintf(" Please enter your choice : "); delay(50); textcolor(11); lev=getche(); } while(!(lev>=49 && lev<=53)); /***** Randomize *****/ if(lev==49) { tim=15; } if(lev==50) { tim=21; } if(lev==51) { tim=28; } if(lev==52) { tim=36; } if(lev==53) { tim=45; } r[0]=123; randomize(); for(i=1;i<=tim;i++) { r[i]=random(9); } getch(); board(); menutri(); menu(); } /*****/ void start(void) { int ip,res[45]; flag=0; board(); /*** Count ***/ for(i=9;i>=1;i--) { textcolor(12); gotoxy(37,12); cprintf("%d",i); delay(400); } gotoxy(1,12); clreol(); gotoxy(33,12); cprintf("\"\"\" GO \"\"\""); sound(1800);delay(500);nosound(); delay(400); gotoxy(1,12); clreol(); /*** Start ***/ board(); /*1*/ textcolor(11); sound(1000);delay(50);nosound(); gotoxy(30,5); cprintf("%d",r[1]); delay(700); gotoxy(20,5); clreol(); gotoxy(30,5); ipp[1]=getche(); esc(); res[1]=ipp[1]-48; delay(500); if( res[1]==r[1] ) { textcolor(10); gotoxy(30,5); cprintf("%d",res[1]); } if( res[1]!=r[1] ) { textcolor(7+128); gotoxy(30,5); cprintf("%d",res[1]); mist++; } delay(300); /*2*/ textcolor(11); sound(1000);delay(50);nosound(); gotoxy(28,6); cprintf("%d ",r[2]); cprintf("%d",r[3]); delay(500); gotoxy(1,6); clreol(); textcolor(12); gotoxy(28,6); ipp[2]=getche( ); esc(); res[2]=ipp[2]-48; gotoxy(32,6); ipp[3]=getche(); esc(); res[3]=ipp[3]-48; delay(500); if( res[2]==r[2] ) { textcolor(10); gotoxy(28,6); cprintf("%d",res[2]); } if( res[3]==r[3] ) { textcolor(10); gotoxy(32,6); cprintf("%d",res[3]); } if( res[2]!=r[2] ) { textcolor(7+128); gotoxy(28,6); cprintf("%d",res[2]); mist++; } if( res[3]!=r[3] ) { textcolor(7+128); gotoxy(32,6); cprintf("%d",res[3]); mist++; } delay(300); /*3*/ textcolor(11); sound(1000);delay(50);nosound(); gotoxy(26,7); cprintf("%d ",r[4]);cprintf("%d ",r[5]);cprintf("%d",r[6]); delay(500); gotoxy(1,7); clreol(); textcolor(12); gotoxy(26,7); ipp[4]=getche(); esc(); res[4]=ipp[4]-48; gotoxy(30,7); ipp[5]=getche(); esc(); res[5]=ipp[5]-48; gotoxy(34,7); ipp[6]=getche(); esc(); res[6]=ipp[6]-48; delay(500); if( res[4]==r[4] ) { textcolor(10); gotoxy(26,7); cprintf("%d",res[4]); } if( res[5]==r[5] ) { textcolor(10); gotoxy(30,7); cprintf("%d",res[5]); } if( res[6]==r[6] ) { textcolor(10); gotoxy(34,7); cprintf("%d",res[6]); } if( res[4]!=r[4] ) { textcolor(7+128); gotoxy(26,7); cprintf("%d",res[4]); mist++; } if( res[5]!=r[5] ) { textcolor(7+128); gotoxy(30,7); cprintf("%d",res[5]); mist++; } if( res[6]!=r[6] ) { textcolor(7+128); gotoxy(34,7); cprintf("%d",res[6]); mist++; } delay(300); /*4*/ textcolor(11); sound(1000);delay(50);nosound(); gotoxy(24,8); cprintf("%d ",r[7]);cprintf("%d ",r[8]);cprintf("%d ",r[9]);cprintf("%d",r[10]); delay(600); gotoxy(1,8); clreol(); textcolor(12); gotoxy(24,8); ipp[7]=getche(); esc(); res[7]=ipp[7]-48; gotoxy(28,8); ipp[8]=getche(); esc(); res[8]=ipp[8]-48; gotoxy(32,8); ipp[9]=getche(); esc(); res[9]=ipp[9]-48; gotoxy(36,8); ipp[10]=getche(); esc(); res[10]=ipp[10]-48; delay(500); if( res[7]==r[7] ) { textcolor(10); gotoxy(24,8); cprintf("%d",res[7]); } if( res[8]==r[8] ) { textcolor(10); gotoxy(28,8); cprintf("%d",res[8]); } if( res[9]==r[9] ) { textcolor(10); gotoxy(32,8); cprintf("%d",res[9]); } if( res[10]==r[10] ) { textcolor(10); gotoxy(36,8); cprintf("%d",res[10]); } if( res[7]!=r[7] ) { textcolor(7+128); gotoxy(24,8); cprintf("%d",res[7]); mist++; } if( res[8]!=r[8] ) { textcolor(7+128); gotoxy(28,8); cprintf("%d",res[8]); mist++; } if( res[9]!=r[9] ) { textcolor(7+128); gotoxy(32,8); cprintf("%d",res[9]); mist++; } if( res[10]!=r[10] ) { textcolor(7+128); gotoxy(36,8); cprintf("%d",res[10]); mist++; } delay(300); /*5*/ textcolor(11); sound(1000);delay(50);nosound(); gotoxy(22,9); cprintf("%d ",r[11]);cprintf("%d ",r[12]);cprintf("%d ",r[13]); cprintf("%d ",r[14]);cprintf("%d",r[15]); delay(700); gotoxy(1,9); clreol(); textcolor(12); gotoxy(22,9); ipp[11]=getche(); esc(); res[11]=ipp[11]-48; gotoxy(26,9); ipp[12]=getche(); esc(); res[12]=ipp[12]-48; gotoxy(30,9); ipp[13]=getche(); esc(); res[13]=ipp[13]-48; gotoxy(34,9); ipp[14]=getche(); esc(); res[14]=ipp[14]-48; gotoxy(38,9); ipp[15]=getche(); esc(); res[15]=ipp[15]-48; delay(500); if( res[11]==r[11] ) { textcolor(10); gotoxy(22,9); cprintf("%d",res[11]); } if( res[11]!=r[11] ) { textcolor(7+128); gotoxy(22,9); cprintf("%d",res[11]); mist++; } if( res[12]==r[12] ) { textcolor(10); gotoxy(26,9); cprintf("%d",res[12]); } if( res[12]!=r[12] ) { textcolor(7+128); gotoxy(26,9); cprintf("%d",res[12]); mist++; } if( res[13]==r[13] ) { textcolor(10); gotoxy(30,9); cprintf("%d",res[13]); } if( res[13]!=r[13] ) { textcolor(7+128); gotoxy(30,9); cprintf("%d",res[13]); mist++; } if( res[14]==r[14] ) { textcolor(10); gotoxy(34,9); cprintf("%d",res[14]); } if( res[14]!=r[14] ) { textcolor(7+128); gotoxy(34,9); cprintf("%d",res[14]); mist++; } if( res[15]==r[15] ) { textcolor(10); gotoxy(38,9); cprintf("%d",res[15]); } if( res[15]!=r[15] ) { textcolor(7+128); gotoxy(38,9); cprintf("%d",res[15]); mist++; } delay(400); if(lev==49) { check(); } /*6*/ if(lev>=50 && flag==0) { textcolor(11); sound(1000);delay(50);nosound(); gotoxy(20,10); cprintf("%d ",r[16]);cprintf("%d ",r[17]);cprintf("%d ",r[18]); cprintf("%d ",r[19]);cprintf("%d ",r[20]);cprintf("%d ",r[21]); delay(900); gotoxy(1,10); clreol(); textcolor(12); gotoxy(20,10);ipp[16]=getche();esc();res[16]=ipp[16]-48; gotoxy(24,10);ipp[17]=getche();esc();res[17]=ipp[17]-48; gotoxy(28,10);ipp[18]=getche();esc();res[18]=ipp[18]-48; gotoxy(32,10);ipp[19]=getche();esc();res[19]=ipp[19]-48; gotoxy(36,10);ipp[20]=getche();esc();res[20]=ipp[20]-48; gotoxy(40,10);ipp[21]=getche();esc();res[21]=ipp[21]-48; delay(500); if( res[16]==r[16] ) { textcolor(10); gotoxy(20,10); cprintf("%d",res[16]); } if( res[16]!=r[16] ) { textcolor(7+128); gotoxy(20,10); cprintf("%d",res[16]); mist++; } if( res[17]==r[17] ) { textcolor(10); gotoxy(24,10); cprintf("%d",res[17]); } if( res[17]!=r[17] ) { textcolor(7+128); gotoxy(24,10); cprintf("%d",res[17]); mist++; } if( res[18]==r[18] ) { textcolor(10); gotoxy(28,10); cprintf("%d",res[18]); } if( res[18]!=r[18] ) { textcolor(7+128); gotoxy(28,10); cprintf("%d",res[18]); mist++; } if( res[19]==r[19] ) { textcolor(10); gotoxy(32,10); cprintf("%d",res[19]); } if( res[19]!=r[19] ) { textcolor(7+128); gotoxy(32,10); cprintf("%d",res[19]); mist++; } if( res[20]==r[20] ) { textcolor(10); gotoxy(36,10); cprintf("%d",res[20]); } if( res[20]!=r[20] ) { textcolor(7+128); gotoxy(36,10); cprintf("%d",res[20]); mist++; } if( res[21]==r[21] ) { textcolor(10); gotoxy(40,10); cprintf("%d",res[21]); } if( res[21]!=r[21] ) { textcolor(7+128); gotoxy(40,10); cprintf("%d",res[21]); mist++; } delay(400); if(lev==50) { check(); } /*7*/ if(lev>=51 && flag==0) { textcolor(11); sound(1000);delay(50);nosound(); gotoxy(18,11); cprintf("%d ",r[22]);cprintf("%d ",r[23]);cprintf("%d ",r[24]); cprintf("%d ",r[25]);cprintf("%d ",r[26]);cprintf("%d ",r[27]); cprintf("%d",r[28]); delay(1400); gotoxy(1,11); clreol(); textcolor(12); gotoxy(18,11);ipp[22]=getche();esc();res[22]=ipp[22]-48; gotoxy(22,11);ipp[23]=getche();esc();res[23]=ipp[23]-48; gotoxy(26,11);ipp[24]=getche();esc();res[24]=ipp[24]-48; gotoxy(30,11);ipp[25]=getche();esc();res[25]=ipp[25]-48; gotoxy(34,11);ipp[26]=getche();esc();res[26]=ipp[26]-48; gotoxy(38,11);ipp[27]=getche();esc();res[27]=ipp[27]-48; gotoxy(42,11);ipp[28]=getche();esc();res[28]=ipp[28]-48; delay(500); if( res[22]==r[22] ) { textcolor(10); gotoxy(18,11); cprintf("%d",res[22]); } if( res[22]!=r[22] ) { textcolor(7+128); gotoxy(18,11); cprintf("%d",res[22]); mist++; } if( res[23]==r[23] ) { textcolor(10); gotoxy(22,11); cprintf("%d",res[23]); } if( res[23]!=r[23] ) { textcolor(7+128); gotoxy(22,11); cprintf("%d",res[23]); mist++; } if( res[24]==r[24] ) { textcolor(10); gotoxy(26,11); cprintf("%d",res[24]); } if( res[24]!=r[24] ) { textcolor(7+128); gotoxy(26,11); cprintf("%d",res[24]); mist++; } if( res[25]==r[25] ) { textcolor(10); gotoxy(30,11); cprintf("%d",res[25]); } if( res[25]!=r[25] ) { textcolor(7+128); gotoxy(30,11); cprintf("%d",res[25]); mist++; } if( res[26]==r[26] ) { textcolor(10); gotoxy(34,11); cprintf("%d",res[26]); } if( res[26]!=r[26] ) { textcolor(7+128); gotoxy(34,11); cprintf("%d",res[26]); mist++; } if( res[27]==r[27] ) { textcolor(10); gotoxy(38,11); cprintf("%d",res[27]); } if( res[27]!=r[27] ) { textcolor(7+128); gotoxy(38,11); cprintf("%d",res[27]); mist++; } if( res[28]==r[28] ) { textcolor(10); gotoxy(42,11); cprintf("%d",res[28]); } if( res[28]!=r[28] ) { textcolor(7+128); gotoxy(42,11); cprintf("%d",res[28]); mist++; } delay(400); if(lev==51) { check(); } /*8*/ if(lev>=52 && flag==0) { textcolor(11); sound(1000);delay(50);nosound(); gotoxy(16,12); cprintf("%d ",r[29]);cprintf("%d ",r[30]);cprintf("%d ",r[31]); cprintf("%d ",r[32]);cprintf("%d ",r[33]);cprintf("%d ",r[34]); cprintf("%d ",r[35]);cprintf("%d",r[36]); delay(1900); gotoxy(1,12); clreol(); textcolor(12); gotoxy(16,12);ipp[29]=getche();esc();res[29]=ipp[29]-48; gotoxy(20,12);ipp[30]=getche();esc();res[30]=ipp[30]-48; gotoxy(24,12);ipp[31]=getche();esc();res[31]=ipp[31]-48; gotoxy(28,12);ipp[32]=getche();esc();res[32]=ipp[32]-48; gotoxy(32,12);ipp[33]=getche();esc();res[33]=ipp[33]-48; gotoxy(36,12);ipp[34]=getche();esc();res[34]=ipp[34]-48; gotoxy(40,12);ipp[35]=getche();esc();res[35]=ipp[35]-48; gotoxy(44,12);ipp[36]=getche();esc();res[36]=ipp[36]-48; delay(500); if( res[29]==r[29] ) { textcolor(10); gotoxy(16,12); cprintf("%d",res[29]); } if( res[29]!=r[29] ) { textcolor(7+128); gotoxy(16,12); cprintf("%d",res[29]); mist++; } if( res[30]==r[30] ) { textcolor(10); gotoxy(20,12); cprintf("%d",res[30]); } if( res[30]!=r[30] ) { textcolor(7+128); gotoxy(20,12); cprintf("%d",res[30]); mist++; } if( res[31]==r[31] ) { textcolor(10); gotoxy(24,12); cprintf("%d",res[31]); } if( res[31]!=r[31] ) { textcolor(7+128); gotoxy(24,12); cprintf("%d",res[31]); mist++; } if( res[32]==r[32] ) { textcolor(10); gotoxy(28,12); cprintf("%d",res[32]); } if( res[32]!=r[32] ) { textcolor(7+128); gotoxy(28,12); cprintf("%d",res[32]); mist++; } if( res[33]==r[33] ) { textcolor(10); gotoxy(32,12); cprintf("%d",res[33]); } if( res[33]!=r[33] ) { textcolor(7+128); gotoxy(32,12); cprintf("%d",res[33]); mist++; } if( res[34]==r[34] ) { textcolor(10); gotoxy(36,12); cprintf("%d",res[34]); } if( res[34]!=r[34] ) { textcolor(7+128); gotoxy(36,12); cprintf("%d",res[34]); mist++; } if( res[35]==r[35] ) { textcolor(10); gotoxy(40,12); cprintf("%d",res[35]); } if( res[35]!=r[35] ) { textcolor(7+128); gotoxy(40,12); cprintf("%d",res[35]); mist++; } if( res[36]==r[36] ) { textcolor(10); gotoxy(44,12); cprintf("%d",res[36]); } if( res[36]!=r[36] ) { textcolor(7+128); gotoxy(44,12); cprintf("%d",res[36]); mist++; } delay(400); if(lev==52) { check(); } /*9*/ if(lev>=53 && flag==0) { textcolor(11); sound(1000);delay(50);nosound(); gotoxy(14,13); cprintf("%d ",r[37]);cprintf("%d ",r[38]);cprintf("%d ",r[39]); cprintf("%d ",r[40]);cprintf("%d ",r[41]);cprintf("%d ",r[42]); cprintf("%d ",r[43]);cprintf("%d ",r[44]);cprintf("%d",r[45]); delay(2300); gotoxy(1,13); clreol(); textcolor(12); gotoxy(14,13);ipp[37]=getche();esc();res[37]=ipp[37]-48; gotoxy(18,13);ipp[38]=getche();esc();res[38]=ipp[38]-48; gotoxy(22,13);ipp[39]=getche();esc();res[39]=ipp[39]-48; gotoxy(26,13);ipp[40]=getche();esc();res[40]=ipp[40]-48; gotoxy(30,13);ipp[41]=getche();esc();res[41]=ipp[41]-48; gotoxy(34,13);ipp[42]=getche();esc();res[42]=ipp[42]-48; gotoxy(38,13);ipp[43]=getche();esc();res[43]=ipp[43]-48; gotoxy(42,13);ipp[44]=getche();esc();res[44]=ipp[44]-48; gotoxy(46,13);ipp[45]=getche();esc();res[45]=ipp[45]-48; delay(500); if( res[37]==r[37] ) { textcolor(10); gotoxy(14,13); cprintf("%d",res[37]); } if( res[37]!=r[37] ) { textcolor(7+128); gotoxy(14,13); cprintf("%d",res[37]); mist++; } if( res[38]==r[38] ) { textcolor(10); gotoxy(18,13); cprintf("%d",res[38]); } if( res[38]!=r[38] ) { textcolor(7+128); gotoxy(18,13); cprintf("%d",res[38]); mist++; } if( res[39]==r[39] ) { textcolor(10); gotoxy(22,13); cprintf("%d",res[39]); } if( res[39]!=r[39] ) { textcolor(7+128); gotoxy(22,13); cprintf("%d",res[39]); mist++; } if( res[40]==r[40] ) { textcolor(10); gotoxy(26,13); cprintf("%d",res[40]); } if( res[40]!=r[40] ) { textcolor(7+128); gotoxy(26,13); cprintf("%d",res[40]); mist++; } if( res[41]==r[41] ) { textcolor(10); gotoxy(30,13); cprintf("%d",res[41]); } if( res[41]!=r[41] ) { textcolor(7+128); gotoxy(30,13); cprintf("%d",res[41]); mist++; } if( res[42]==r[42] ) { textcolor(10); gotoxy(34,13); cprintf("%d",res[42]); } if( res[42]!=r[42] ) { textcolor(7+128); gotoxy(34,13); cprintf("%d",res[42]); mist++; } if( res[43]==r[43] ) { textcolor(10); gotoxy(38,13); cprintf("%d",res[43]); } if( res[43]!=r[43] ) { textcolor(7+128); gotoxy(38,13); cprintf("%d",res[43]); mist++; } if( res[44]==r[44] ) { textcolor(10); gotoxy(42,13); cprintf("%d",res[44]); } if( res[44]!=r[44] ) { textcolor(7+128); gotoxy(42,13); cprintf("%d",res[44]); mist++; } if( res[45]==r[45] ) { textcolor(10); gotoxy(46,13); cprintf("%d",res[45]); } if( res[45]!=r[45] ) { textcolor(7+128); gotoxy(46,13); cprintf("%d",res[45]); mist++; } delay(400); if(lev==53) { check(); } /*10*//*if(lev==53 && flag==0) { textcolor(11); sound(1000);delay(50);nosound(); gotoxy(12,14); cprintf("%d ",r[46]);cprintf("%d ",r[47]);cprintf("%d ",r[48]); cprintf("%d ",r[49]);cprintf("%d ",r[50]);cprintf("%d ",r[51]); cprintf("%d ",r[52]);cprintf("%d ",r[53]);cprintf("%d ",r[54]); cprintf("%d",r[55]); delay(2700); gotoxy(1,14); clreol(); textcolor(12); gotoxy(12,14);ipp[46]=getche();res[46]=ipp[46]-48; gotoxy(16,14);ipp[47]=getche();res[47]=ipp[47]-48; gotoxy(20,14);ipp[48]=getche();res[48]=ipp[48]-48; gotoxy(24,14);ipp[49]=getche();res[49]=ipp[49]-48; gotoxy(28,14);ipp[50]=getche();res[50]=ipp[50]-48; gotoxy(32,14);ipp[51]=getche();res[51]=ipp[51]-48; gotoxy(36,14);ipp[52]=getche();res[52]=ipp[52]-48; gotoxy(40,14);ipp[53]=getche();res[53]=ipp[53]-48; gotoxy(44,14);ipp[54]=getche();res[54]=ipp[54]-48; gotoxy(48,14);ipp[55]=getche();res[55]=ipp[55]-48; delay(500); if( res[46]==r[46] ) { textcolor(10); gotoxy(12,14); cprintf("%d",res[46]); } if( res[46]!=r[46] ) { textcolor(7+128); gotoxy(12,13); cprintf("%d",res[46]); mist++; } if( res[47]==r[47] ) { textcolor(10); gotoxy(16,14); cprintf("%d",res[47]); } if( res[47]!=r[47] ) { textcolor(7+128); gotoxy(16,14); cprintf("%d",res[47]); mist++; } if( res[48]==r[48] ) { textcolor(10); gotoxy(20,14); cprintf("%d",res[48]); } if( res[48]!=r[48] ) { textcolor(7+128); gotoxy(20,14); cprintf("%d",res[48]); mist++; } if( res[49]==r[49] ) { textcolor(10); gotoxy(24,14); cprintf("%d",res[49]); } if( res[49]!=r[49] ) { textcolor(7+128); gotoxy(24,14); cprintf("%d",res[49]); mist++; } if( res[50]==r[50] ) { textcolor(10); gotoxy(28,14); cprintf("%d",res[50]); } if( res[50]!=r[50] ) { textcolor(7+128); gotoxy(28,14); cprintf("%d",res[50]); mist++; } if( res[51]==r[51] ) { textcolor(10); gotoxy(32,14); cprintf("%d",res[51]); } if( res[51]!=r[51] ) { textcolor(7+128); gotoxy(32,14); cprintf("%d",res[51]); mist++; } if( res[52]==r[52] ) { textcolor(10); gotoxy(36,14); cprintf("%d",res[52]); } if( res[52]!=r[52] ) { textcolor(7+128); gotoxy(36,14); cprintf("%d",res[52]); mist++; } if( res[53]==r[53] ) { textcolor(10); gotoxy(40,14); cprintf("%d",res[53]); } if( res[53]!=r[53] ) { textcolor(7+128); gotoxy(40,14); cprintf("%d",res[53]); mist++; } if( res[54]==r[54] ) { textcolor(10); gotoxy(44,14); cprintf("%d",res[54]); } if( res[54]!=r[54] ) { textcolor(7+128); gotoxy(44,14); cprintf("%d",res[54]); mist++; } if( res[55]==r[55] ) { textcolor(10); gotoxy(48,14); cprintf("%d",res[55]); } if( res[55]!=r[55] ) { textcolor(7+128); gotoxy(48,14); cprintf("%d",res[55]); mist++; } delay(400); */ check(); //}//10 }//9 }//8 }//7 }//6 getch(); clrscr(); board(); menutri(); menu(); } /*****/ void check(void) { switch (lev) { case 49 : if( mist==0 ) { win(); } if( mist>0 && mist<=3 ) { good(); } if( mist>3 && mist<=5 ) { fair(); } if( mist>5 ) { lose(); } break; case 50 : if( mist==0 ) { win(); } if( mist>0 && mist<=4 ) { good(); } if( mist>4 && mist<=7 ) { fair(); } if( mist>7 ) { lose(); } break; case 51 : if( mist==0 ) { win(); } if( mist>0 && mist<=6 ) { good(); } if( mist>6 && mist<=10 ) { fair(); } if( mist>10 ) { lose(); } break; case 52 : if( mist==0 ) { win(); } if( mist>0 && mist<=9 ) { good(); } if( mist>9 && mist<=14 ) { fair(); } if( mist>14 ) { lose(); } break; case 53 : if( mist==0 ) { win(); } if( mist>0 && mist<=12 ) { good(); } if( mist>12 && mist<=19 ) { fair(); } if( mist>19 ) { lose(); } break; /*case 54 : if( mist==0 ) { win(); } if( mist>0 && mist<=15 ) { good(); } if( mist>15 && mist<=25 ) { fair(); } if( mist>25 ) { lose(); } break;*/ } flag=1; } /*****/ void win(void) { textcolor(13); gotoxy(8,20); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); delay(80); gotoxy(8,21); cprintf("º º"); delay(80); gotoxy(8,22); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); delay(80); textcolor(11); gotoxy(12,21); sound(3900);delay(62);cprintf("C");nosound(); sound(3800);delay(62);cprintf("O");nosound(); sound(3700);delay(62);cprintf("N");nosound(); sound(3600);delay(62);cprintf("G");nosound(); sound(3500);delay(62);cprintf("R");nosound(); sound(3400);delay(62);cprintf("A");nosound(); sound(3300);delay(62);cprintf("T");nosound(); sound(3200);delay(62);cprintf("U");nosound(); sound(3100);delay(62);cprintf("L");nosound(); sound(3000);delay(62);cprintf("A");nosound(); sound(2900);delay(62);cprintf("T");nosound(); sound(2800);delay(62);cprintf("I");nosound(); sound(2700);delay(62);cprintf("O");nosound(); sound(2600);delay(62);cprintf("N");nosound(); textcolor(9); gotoxy(31,21); cprintf("You Win , You Have An Excellent Mind."); sound(3000); delay(100); nosound(); sound(4000); delay(100); nosound(); sound(2000); delay(100); nosound(); sound(3000); delay(100); nosound(); } /*****/ void good(void) { textcolor(13); gotoxy(15,20); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); delay(80); gotoxy(15,21); cprintf("º º"); delay(80); gotoxy(15,22); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); delay(80); textcolor(11); gotoxy(21,21); delay(70);cprintf("W"); delay(70);cprintf("E"); delay(70);cprintf("L"); delay(70);cprintf("L"); sound(3000); delay(100); nosound(); sound(4000); delay(100); nosound(); sound(2000); delay(100); nosound(); sound(3000); delay(100); nosound(); textcolor(9); gotoxy(33,21); cprintf("You Have Done A Good Job."); } /*****/ void fair(void) { textcolor(13); gotoxy(15,20); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); delay(80); gotoxy(15,21); cprintf("º º"); delay(80); gotoxy(15,22); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); delay(80); textcolor(11); gotoxy(23,21); delay(70);cprintf("F"); delay(70);cprintf("A"); delay(70);cprintf("I"); delay(70);cprintf("R"); sound(3000); delay(100); nosound(); sound(4000); delay(100); nosound(); sound(2000); delay(100); nosound(); sound(3000); delay(100); nosound(); textcolor(9); gotoxy(35,21); cprintf("Better Luck Next Time."); } /*****/ void lose(void) { textcolor(13); gotoxy(14,20); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); delay(80); gotoxy(14,21); cprintf("º º"); delay(80); gotoxy(14,22); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); delay(80); textcolor(9); gotoxy(20,21); cprintf("SORRY To Say That You Loose , Try Again."); sound(3000); delay(250); nosound(); sound(500); delay(150); nosound(); } /*****/ void quit(void) { clrscr(); textcolor(11); gotoxy(5,22); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); gotoxy(5,23); cprintf("º THANKS FOR PLAYING MY GAME.........................UZAIR AHMAD. º"); gotoxy(5,24); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); sound(1500);delay(350);nosound(); delay(1150); mist=0; flag=0; textcolor(7); textbackground(0); clrscr(); _setcursortype(_NORMALCURSOR); exit(EXIT_SUCCESS); } /*****/ void box(void) { textcolor(colr); gotoxy(2,2); cprintf("ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»"); delay(20); for(i=3;i<=22;i++) { gotoxy(2,i); cprintf("º º"); delay(20); } gotoxy(2,23); cprintf("ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ"); delay(20); } /*****/ void esc(void) { int n; for(n=1;n<=45;n++) { if(ipp[n]==27) { board(); menutri(); menu(); } } }