#include <stdio.h>#include <allegro.h>main(){//Inicializando Allegro y dispositivosallegro_init();install_keyboard();install_mouse();install_timer();set_color_depth(8);set_gfx_mode(GFX_AUTODETECT,800,600,0,0);while(!key[KEY_ESC]){//creando triangulo ............. "negro"line(screen, 350,250, 110,500, 1);line(screen, 350,240, 90,510, 1);line(screen, 110,500, 680,500, 1);line(screen, 90,510, 710,510, 1);line(screen, 680,500, 350,250, 1);line(screen, 710,510, 350,240, 1);//creando menu.............................rectfill(screen, 200,70, 600,200, 27);rectfill(screen, 202,72, 598,198, 22);text_mode(22);textprintf(screen, font, 230,100, 43, "PRESIONO A......(ROJO)"); //4textprintf(screen, font, 230,125, 43, "PRESIONO B......(VERDE)");//47textprintf(screen, font, 230,150, 43, "PRESIONO C......(AZUL)"); //9textprintf(screen, font, 230,175, 43, "PRESIONO D......(AMARILLO)");//14readkey();if(key[KEY_A]){floodfill(screen, 350,248, 4);readkey();}if(key[KEY_B]){floodfill(screen, 350,248, 47);readkey();}if(key[KEY_C]){floodfill(screen, 350,248, 9);readkey();}if(key[KEY_D]){floodfill(screen, 350,248, 14);readkey();}}allegro_exit();}END_OF_MAIN();
#include<stdio.h>#include<conio.h>#include<graphics.h>void main(){int op;clrscr();printf("\n\n\tMENU PRINCIPAL\n");printf("\t==============\n\n");printf("\t1) Azul\n");printf("\t2) Verde\n");printf("\t3) Rojo\n");printf("\t4) Amarillo\n");printf("\t5) Salir\n");printf("\nSeleccione color del triangulo(1-5): ");scanf("%d",&op);switch(op){case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;default:printf("\nOpcion incorrecta");}getch();}