Menu UP-DOWN

Este es un programilla al que le puede adaptar cualquier cantidad de opciones que se pueden escoger con la flechas UP-DOWN


#define MAX 10
void menu_opciones(int n,char *menu[],int *m);
void color1();
void color2();
void cargar(int n,int V[MAX]);
void loading(int n);

void color1()
{textbackground(BLACK);textcolor(10);}

void color2()
{textbackground(10);textcolor(0);}

void menu_opciones(int n,char *menu[],int *m)
{
  int linea=0,tecla,p=5,a=7,posiciones[MAX];
for(int x=0;x<n;x++)
{
  posiciones[x]=a;a=a+2;
}
cprintf("NOTA: usar las flechitas UP DOWN");delay(3000);
do{  color1();
  clrscr();
  for(int j=0;j<n;j++)
  {
  gotoxy(15,p=p+2);cprintf(menu[j]);
  }
  p=5;
  color2();
  gotoxy(15,posiciones[0+linea]);cprintf(menu[linea]);

  tecla=getch();

  if(tecla==80)
  {
    if(linea<n-1)
    {linea++;}
  }
  else
  {
    if(tecla==72)
    {
    if(linea>0)
    {linea--;}
    }
  }
  }while(tecla!=13);
  *m=linea;

}

void loading(int n)
{clrscr();
 color2();
 for(int h=1;h<4;h++)
 {
 for(int i=5;i<67;i++)

  {gotoxy(i,24);cout<<" °°±±²²Û";delay(n); }
 for(int j=66;j>4;j--)

 {gotoxy(j,24);cout<<"Û²²±±°° ";delay(n); }

 }

}

 //SI QUIEREN PUEDEN CAMBIAR DE COLORCITO HACERLO SIN MUCHO ESPACIO
//************************ main ******************************

#include <stdio.h>
#include <conio.h>
#include <dos.h>
#include <iostream.h>
#include <pablo.h>

void main()
{

  char *menu[7]={"COPY RIGHT 2007","T. E. C.- S.U.P. ELECTRONICA","A L A N O C A","A D U V I R I ","P A B L O","H E L P","S A L I R"};
  //puede cambiar a su gusto el menu de la siguiente manera
  //char *menu[numero de opciones]={"1","2",......,"n"};
  //PARA QUE TENGA BUENA PRESENTACION MENOS DE 10 OPCIONES
  int op;
  clrscr();
  loading(10);
  menu_opciones(7,menu,&op); //menu_opciones(cantidad de opciones,el menu,devuelve la opcion);

  cprintf(" %d",op);  //el valor de op puedes adaptarlo para switch o craerte funciones o hasta para punteros
  getch();

}