Autor
|
Tema: CREAR UNA PERSONA EN [C++] (Leído 11,405 veces)
|
Ragnarok
|
No necesitas conio para nada, con poner espacios al principio de cada cadena vale.
|
|
|
En línea
|
|
|
|
KFMaguz
Desconectado
Mensajes: 21
www.kinfer.cl.kz
|
es conio.h no conio.c En realidad agrege unos archivos a la carpeta include del dev-c++ para ocupar esa libreria  El ejecutable corre con estos codigos  Ragnarok: "Felicidades. Publícalo si quieres pero, aparte de que este mensaje no añade nada al hilo, se salta las normas, por eso he quitado el estilo a la letra. Recuerda revisar las normas" Disculpa, solo vi el boton de esa letra y me gusto.
Aca como lo prometi les traigo 2 codigos del mismo ejercicio. Una es la mia y otra la de un compañero ^^ ambos estran buenos, x si alguien lo quiere realizar  Este es el mio #include <conio.c> #include <stdio.h> int estatura, pelo, ojos, boca, chaleco, pantalon; int control=1; int repetir=1; int opcion; int main(){ while(repetir==1) { textcolor(9); printf("\n:::::PROGRAMA PARA CREAR RETRATO DE UN INDIVIDUO:::::\n"); textcolor(10); printf("\n\n\Como es la estatura del individuo:\n"); textcolor(15); printf("1)Chico: Menor o igual a 1.50mt\n2)Mediano: Mayor a 1.50mt y menor o igual a 1.75mt\n3)Alto: Mayor a 1.75mt\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); while(control==1) { switch (opcion) { case 1: estatura=1; control=0; break; case 2: estatura=2; control=0; break; case 3: estatura=3; control=0; break; default: textcolor(12); printf("\nERROR:"); textcolor(15); printf("No existe esa opcion\nVuelva a elegir\n"); textcolor(10); printf("\n\n\Como es la estatura del individuo:\n"); textcolor(15); printf("1)Chico: Menor o igual a 1.50mt\n2)Mediano: Mayor a 1.50mt y menor o igual a 1.75mt\n3)Alto: Mayor a 1.75mt\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); break; } }
textcolor(10); printf("\n\nComo es el Pelo del individuo: \n"); textcolor(15); printf("1)Natural \n2)Ondulado \n3)Peinado\n"); textcolor(14); printf("Respuesta:"); textcolor(15); control=1; scanf ("%d", &opcion); while(control==1) { switch (opcion) { case 1: pelo=1; control=0; break; case 2: pelo=2; control=0; break; case 3: pelo=3; control=0; break; default: textcolor(12); printf("\nERROR:"); textcolor(15); printf("No existe esa opcion\nVuelva a elegir\n"); textcolor(10); printf("\n\nComo es el Pelo del individuo: \n"); textcolor(15); printf("1)Natural \n2)Ondulado \n3)Peinado\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); break; } }
textcolor(10); printf("\n\nEl individuo usa Lentes:"); textcolor(15); printf("\n1)No, no usa lentes \n2)Si, si usa lentes\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); control =1; while(control==1) { switch (opcion) { case 1: ojos=1; control=0; break; case 2: ojos=2; control=0; break; default: textcolor(12); printf("\nERROR:"); textcolor(15); printf("No existe esa opcion\nVuelva a elegir\n"); textcolor(10); printf("\n\nEl individuo usa Lentes:"); textcolor(15); printf("\n1)No, no usa lentes \n2)Si, si usa lentes\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); break; } }
textcolor(10); printf("\n\nEstado de animo del individuo:"); textcolor(15); printf("\n1)Feliz \n2)Normal\n3)Triste\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); control =1; while(control==1) { switch (opcion) { case 1: boca=1; control=0; break; case 2: boca=2; control=0; break; case 3: boca=3; control=0; break; default: textcolor(12); printf("\nERROR:"); textcolor(15); printf("No existe esa opcion\nVuelva a elegir\n"); textcolor(10); printf("\n\nEstado de animo del individuo:"); textcolor(15); printf("\n1)Feliz \n2)Normal\n3)Triste\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); break; } }
textcolor(10); printf("\n\nColor del chaleco:"); textcolor(15); printf("\n1)Rojo \n2)Verde\n3)Azul\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); control =1; while(control==1) { switch (opcion) { case 1: chaleco=12; control=0; break; case 2: chaleco=2; control=0; break; case 3: chaleco=1; control=0; break; default: textcolor(12); printf("\nERROR:"); textcolor(15); printf("No existe esa opcion\nVuelva a elegir\n"); textcolor(10); printf("\n\nColor del chaleco:"); textcolor(15); printf("\n1)Rojo \n2)Verde\n3)Azul\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); break; } }
textcolor(10); printf("\n\nColor del pantalon:"); textcolor(15); printf("\n1)Azul Oscuro \n2)Azul\n3)Verde\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); control =1; while(control==1) { switch (opcion) { case 1: pantalon=1; control=0; break; case 2: pantalon=9; control=0; break; case 3: pantalon=2; control=0; break; default: textcolor(12); printf ("\nERROR:"); textcolor(15);printf("No existe esa opcion\nVuelva a elegir\n"); textcolor(10); printf("\n\nColor del pantalon:"); textcolor(15); printf("\n1)Azul Oscuro \n2)Azul\n3)Verde\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%d", &opcion); break; } }
textcolor(9); printf("\n\n::::::::::ESTE ES EL RETRATO DE SU INDIVIDUO::::::::::\n\n"); textcolor(6); if (pelo==1) printf (" WWWWWWWWWW \n"); if (pelo==2) printf (" @@@@@@@@@@ \n"); if(pelo==3) printf (" |||||||||| \n"); textcolor(7);
printf (" | |\n"); //imprimir frente
if (ojos==1) printf (" @| O O |@\n"); if (ojos==2) printf (" @|-(o)(o)-|@\n");
printf (" | ( |\n"); //imprime nariz
if (boca==1) printf (" | \\____/ |\n"); if (boca==2) printf (" | ---- |\n"); if(boca==3) printf (" | ----¿ |\n");
printf (" \\______/\n"); //imprime pera
switch (estatura) { case 1: { textcolor(chaleco); printf (" ________"); textcolor(7); printf ("| |"); textcolor(chaleco); printf("________"); textbackground(0); printf (" \n"); textcolor(0); textbackground(0); printf (" "); textbackground(chaleco); printf("| o |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| o |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(7); printf (" uuuu"); textcolor(0); textbackground(chaleco); printf ("|_______o_______|"); textbackground(0); textcolor(7); printf ("uuuu"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("|_______|_______|"); textbackground(0); printf (" \n"); textbackground(0) ;textcolor(7); printf (" |_____| |_____|"); textbackground(0); printf (" \n\n"); break; }
case 2: { textcolor(chaleco); printf (" ________"); textcolor(7); printf ("| |"); textcolor(chaleco); printf("________"); textbackground(0); printf (" \n"); textcolor(0); textbackground(0); printf (" "); textbackground(chaleco); printf("| o |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| o |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(7); printf (" uuuu "); textcolor(0); textbackground(chaleco); printf ("I O I"); textbackground(0); textcolor(7); printf (" uuuu"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(chaleco); printf("|_______o_______|"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("|_______|_______|"); textbackground(0); printf (" \n"); textbackground(0) ;textcolor(7); printf (" |_____| |_____|"); textbackground(0); printf (" \n\n"); break; } case 3: { textcolor(chaleco); printf (" ________"); textcolor(7); printf ("| |"); textcolor(chaleco); printf("________"); textbackground(0); printf (" \n"); textcolor(0); textbackground(0); printf (" "); textbackground(chaleco); printf("| o |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| o |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); printf (" "); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(chaleco); printf ("| | o | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(7); printf (" uuuu "); textcolor(0); textbackground(chaleco); printf ("| o |"); textbackground(0); textcolor(7); printf (" uuuu"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(chaleco); printf("|_______o_______|"); textbackground(0); printf (" \n");
textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("| | |"); textbackground(0); printf (" \n"); textbackground(0); textcolor(0); printf (" "); textbackground(pantalon); printf("|_______|_______|"); textbackground(0); printf (" \n"); textbackground(0) ;textcolor(7); printf (" I_____I I_____I"); textbackground(0); printf (" \n\n"); break; } } textbackground(0); textcolor(10); printf ("Que desea hacer ahora?:\n"); textcolor(15); printf("Escriba 1 para repetir el programa\n"); printf("O cualquier tecla dintinta de 1 para salir\n"); textcolor(14); printf("Respuesta:"); textcolor(15); scanf ("%i", &control); if (control==1) repetir=1; else repetir=0; } }
Este es el de mi compa: #include <conio.c> #include <stdlib.h> #include <stdio.h>
char frente[25] =" | | "; char ojos[25] =" | O O | "; char nariz[25]=" @| ( |@"; char triste[25] =" | /----\\ |"; char lentes[25]=" |-(o)(o)-| "; char contento[25]=" | \\____/ |"; char pelolais[25]=" |||||||||| "; char pelonormal[25]=" ^^^^^^^^^^ "; char peloondulado[25]=" @@@@@@@@@@ "; int estatura,lente,pelo,cara; int control=1; int repetir=1;
int main(){ while(repetir==1) { do { textcolor(LIGHTGREEN); printf("\n\n\ Ingrese Numero de la opcion de estatura que desea:\n\n"); textcolor(WHITE); printf(" 1 CHICO: menor o igual a 1.50mt\n 2 MEDIANO: mayor a 1.50 y menor o igual a 1.70mt\n 3 ALTO: mayor a 1.70mt\n\n"); printf("Su opcion elegida es: "); scanf("%i",& estatura); if (estatura<1 || estatura>3){ printf ("\n SOLO PUEDE INGRESAR OPCIONES DE 1 a 3\n"); } }while (estatura<1 || estatura >3); clrscr(); do{ textcolor(LIGHTGREEN); printf("\n\n\ Ingrese Numero de la opcion de pelo que desea:\n\n"); textcolor(WHITE); printf(" 1 LISO \n 2 NORMAL \n 3 ONDULADO\n\n"); printf("Su opcion elegida es: "); scanf("%i",& pelo); if (pelo<1 || pelo>3){ printf ("\n SOLO PUEDE INGRESAR OPCIONES DE 1 a 3\n"); } }while (pelo<1 || pelo>3); clrscr(); do{ textcolor(LIGHTGREEN); printf("\n\n\ Ingrese numero de la opcion de ojos que desea:\n\n"); textcolor(WHITE); printf(" 1 CON lENTES \n 2 SIN LENTES\n\n"); printf("Su opcion elegida es: "); scanf("%i",& lente); if (lente<1 || lente>2){ printf ("\n SOLO PUEDE INGRESAR OPCIONES DE 1 a 2\n"); } }while (lente<1 || lente >2); clrscr(); do{ textcolor(LIGHTGREEN); printf("\n\n\ Ingrese numero de la opcion de cara que desea:\n\n"); textcolor(WHITE); printf(" 1 CONTENTO \n 2 TRISTE \n\n"); printf("Su opcion elegida es: "); scanf("%i",& cara); if (cara<1 || cara>2){ printf ("\n SOLO PUEDE INGRESAR OPCIONES DE 1 a 2\n"); } }while (cara<1 || cara>2); clrscr();
if (pelo==1){gotoxy(20,5); textcolor(YELLOW); cprintf("%s",pelolais);} {gotoxy(20,6); textcolor(LIGHTGRAY); cprintf("%s",frente);} if (pelo==2){gotoxy(20,5); textcolor(YELLOW); cprintf("%s",pelonormal);} {gotoxy(20,6); textcolor(LIGHTGRAY); cprintf("%s",frente);} if (pelo==3){gotoxy(20,5); textcolor(YELLOW); cprintf("%s",peloondulado);} {gotoxy(20,6); textcolor(LIGHTGRAY); cprintf("%s",frente);} if (lente==1){gotoxy(20,7); textcolor(LIGHTGRAY); cprintf("%s",lentes); gotoxy(20,8); cprintf("%s", nariz);} if (lente==2){gotoxy(20,7); textcolor(LIGHTGRAY); cprintf("%s",ojos); gotoxy(20,8); cprintf("%s", nariz);} if (cara==1){gotoxy(20,9); textcolor(LIGHTGRAY); cprintf("%s",contento);} if (cara==2){gotoxy(20,9); textcolor(LIGHTGRAY); cprintf("%s",triste);} textcolor(LIGHTGRAY) ; if(estatura==1){ textcolor(LIGHTGRAY); printf("\n \\_ _/ "); textcolor(RED) ; printf("\n ______| |_____ "); printf("\n / | O \\ "); printf("\n | | O | | "); printf("\n | | O | | "); printf("\n |__| O |__| "); printf("\n !!!|_____O_____|!!! "); textcolor(BLUE) ; printf("\n | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n |_____|_____| ");textcolor(BROWN) ; printf("\n |___| |___| "); }
if(estatura==2){ textcolor(LIGHTGRAY); printf("\n \\_ _/ "); textcolor(RED) ; printf("\n ______| |______ "); printf("\n / \\ "); printf("\n | | O | | "); printf("\n | | | | "); printf("\n | | O | | "); printf("\n | | | | "); printf("\n |__| O |__| "); printf("\n !!!|_____________|!!! "); textcolor(LIGHTBLUE) ; printf("\n | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n |______|______| "); textcolor(BROWN) ; printf("\n |____| |____| ");} if(estatura==3){ textcolor(LIGHTGRAY); printf("\n \\_ _/ "); textcolor(RED) ; printf("\n ________| |_______ "); printf("\n / \\ "); printf("\n | O | "); printf("\n | | | | "); printf("\n | | O | | "); printf("\n | | | | "); printf("\n | | O | | "); printf("\n | | | | "); printf("\n |___| O |___| "); printf("\n !!!|_____________|!!! "); textcolor(LIGHTBLUE) ; printf("\n | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n | | | "); printf("\n |______|______| "); textcolor(BROWN) ; printf("\n |____| |____| "); } textcolor(WHITE); system("pause"); clrscr();
textcolor(YELLOW); printf ("QUE OPCION DESEA REALIZAR AHORA:\n"); textcolor(WHITE); printf("\n\n Ingrese:\n\n 1 Para reiniciar el programa\n 2 : para Salir de la aplicacion \n"); scanf ("%i", &control); if (control==1) repetir=1; else repetir=0; clrscr(); } }
|
|
« Última modificación: 21 Mayo 2008, 01:38 am por Save!~. »
|
En línea
|
|
|
|
barbate
Desconectado
Mensajes: 21
|
muy bien, yo hubiera usado for apra tantas repeticiones, pero si le programa funciona...  un saludo
|
|
|
En línea
|
|
|
|
Crazy.sx
Desconectado
Mensajes: 447
|
Esta bueno esto che jajaja, y de paso me sirve para poder retomar de nuevo la practica en C (hace bastante que no lo toco). Solo le falta bailar....  Saludos che 
|
|
|
En línea
|
Destruir K. LOL
|
|
|
|
|