#include<conio.h>

#include<stdio.h>

#include<stdlib.h>

#define kung if

int key,hit,sigepa=0,choice=0;

void kahon(int x,int y,int xx,int yy)

{ int xs,ys;

 for(xs=1;xs<(xx-x);xs++) {gotoxy(x+xs,y);printf("%c",196); gotoxy(x+xs,yy);printf("%c",196);}

 for(ys=1;ys<(yy-y);ys++) {gotoxy(x,y+ys);printf("%c",179);}

 for(ys=1;ys<(yy-y);ys++) {gotoxy(xx,y+ys);printf("%c",179);}

 gotoxy(x,y);printf("%c",218);  gotoxy(xx,y);printf("%c",191);

 gotoxy(x,yy);printf("%c",192); gotoxy(xx,yy);printf("%c",217);

 }

void tulog() 

{ clrscr();gotoxy(10,20);printf("Rest in peace"); getch();}

void kaon()

{ clrscr();gotoxy(10,20);printf("Anyong Haseo"); getch();}

void laag()

{ clrscr();gotoxy(10,20);printf("Lets Storm the City");getch(); }

void bye()

{ clrscr();gotoxy(10,20);printf("Layas na");getch();sigepa=1; }

 

void display_menu()

{ clrscr();

  kahon(30,10,51,15);textcolor(7);

  gotoxy(31,11);cprintf(" Rest in peace");

  gotoxy(31,12);cprintf(" Anyong Haseo ");

  gotoxy(31,13);cprintf(" Lets Storm the City");

  gotoxy(31,14);cprintf(" Bye Bye");

}

void select_menu()

{     display_menu();

  while (sigepa==0 ) {

   hit=0;

    key=getch();

      kung (key==13) /*mapindutan ang enter*/           { hit=1;}

      kung (key==27) /*matuslokan ang ESC dayon Gawas*/ { break;}

      kung (key==27) /* gawas na */                     { sigepa=1; }

      kung (key==80) /*mapislit ang Down Arrow Key */   { choice=choice+1;}

      kung (key==72) /*mapislit ang Up   Arrow Key */   { choice=choice-1;}

                   kung (choice < 1) { choice=4;}

                   kung (choice > 4) { choice=1;}

 

       /* -------IPAKITA ANG SCREEN ILLUSION---- */

       kung (choice==1) {display_menu();gotoxy(31,11);textcolor(3);cprintf(" Rest in peace");      textcolor(7);}

       kung (choice==2) {display_menu();gotoxy(31,12);textcolor(3);cprintf(" Anyong Haseo ");      textcolor(7);}

       kung (choice==3) {display_menu();gotoxy(31,13);textcolor(3);cprintf(" Lets Storm the City");textcolor(7);}

       kung (choice==4) {display_menu();gotoxy(31,14);textcolor(3);cprintf(" Bye Bye");            textcolor(7);}

     /*-------ibutang dire and buhaton sa computer kung mag tukma ang requirements */

      kung (choice==1 && key==13) {tulog();}

      kung (choice==2 && key==13) {kaon() ;}

      kung (choice==3 && key==13) {laag() ;}

      kung (choice==4 && key==13) {bye() ;}

     /* gotoxy(5,20);printf("%i %i",choice,key);*/

  }

}

 

void main()

{

select_menu();

}

 

 
Make a Free Website with Yola.