elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Recuerda que debes registrarte en el foro para poder participar (preguntar y responder)


  Mostrar Mensajes
Páginas: [1]
1  Programación / Programación C/C++ / Re: ola tengo que hacer el juegoo de mente maestra en lenguaje c .(turbo c ++) en: 5 Diciembre 2011, 23:01 pm
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void marco(int x1,int x2,int y1,int y2);
void preguntar ();
void comparar();
int usuario[4],cpu[4];
int x;
int y;
int c;
int i, f, s;
int g[4];
main()
{
clrscr();
randomize();
g[0]=(rand()%4)+1;
f=g;
for(i=1;i<4;)
{
 g=(rand()%4)+1;
 if(f==g){}
else
{
f=g;
  i++;
 }
}
randomize();
printf("numeros entre 1 y 4 \n \n");
//printf("%d\n",(rand()%4));
g[0]=(rand()%4+1);
for(i=1;i<4;i++);
do{
f=(rand()%4)+1;
s=0;
if(f==g[0])s=0;else s++  ;
if(f==g[1])s=0;else s++ ;
if(f==g[2])s=0;else s++;
}
while(s!=3);
s=0;
g=f;
{
for(i=0;i<=3;i++)
getch();
}

{
printf("%d\n",g)
preguntar(10,10,0)
preguntar(15,10,1)
preguntar(20,10,2)
preguntar(25,10,3)
comparar();
getch();
}
void comparar();
{
int acierto=0;
if (cpu[0]==usuario[0])acierto=acierto +1
if (cpu[1]==usuario[1])acierto=acierto +1
if (cpu[2]==usuario[2])acierto=acierto +1
if (cpu[3]==usuario[3])acierto=acierto +1
gotoxy(30,10);printf("aciertos %d",acierto)
}
void preguntar(int x,  int y , int c)

gotoxy(x,y);
scanf("%d"&usuario[c]);
}
textcolor(1);
textbackground(5);
gotoxy(5,5);printf("ÛÛÛ   ÛÛÛ    Û ÛÛÛ  Û ÛÛÛÛÛ   ÛÛÛ   Û      Û   ÛÛ   Û   Û    ÛÛÛ     Û");
gotoxy(5,6);printf("ÛÛÛÛÛÛÛÛÛ ÛÛÛÛ ÛÛÛÛ Û Û   Û ÛÛÛÛÛÛ ÛÛ  ÛÛ  Û ÛÛÛÛ ÛÛÛÛ ÛÛ ÛÛÛ ÛÛ ÛÛÛ Û");
gotoxy(5,7);printf("ÛÛÛÛÛÛÛÛÛ   ÛÛ ÛÛÛÛÛÛ ÛÛ ÛÛ   ÛÛÛÛÛÛÛ      Û   ÛÛ   ÛÛ ÛÛ ÛÛ ÛÛÛ     Û");
gotoxy(5,8);printf("ÛÛ  Û  ÛÛ ÛÛÛÛ Û ÛÛÛÛ ÛÛ ÛÛ ÛÛÛÛ ÛÛ Û  ÛÛ  Û ÛÛÛÛÛÛ ÛÛ ÛÛ ÛÛÛ ÛÛ ÛÛÛ Û");
gotoxy(5,9);printf("ÛÛ     ÛÛ    Û Û  ÛÛÛ ÛÛ ÛÛ   ÛÛ    Û  ÛÛ  Û   ÛÛ   ÛÛ ÛÛ ÛÛÛÛ Û ÛÛÛ Û");
marco(5,79,5,25);
marco(6,12,11,13);
marco(6,12,14,16);
marco(6,12,17,19);
//marco(6,12,20,22);
marco(13,19,11,13);
marco(13,19,14,16);
marco(13,19,17,19);
//marco(13,19,20,22);
marco(20,26,11,13);
marco(20,26,14,16);
marco(20,26,17,19);
//marco(20,26,20,22);
marco(27,33,11,13);
marco(27,33,14,16);
marco(27,33,17,19);
//marco(27,33,20,22);
textcolor(14);
marco(39,46,12,14); cprintf("primera");
textcolor(10);
marco(39,46,15,17); cprintf("segunda");
textcolor(20);
marco(39,46,18,20); cprintf("tercera");
textcolor(18);
marco(59,76,13,15); cprintf("comienzo");
textcolor(13);
marco(59,76,16,18); cprintf("aciertos");
textcolor(62);
marco(59,76,19,21); cprintf("retirarse");
textcolor(11);
marco(25,80,40,45); cprintf("instrucciones: solo tienes 3 oportunidades para jugar");
textcolor(15);
marco(25,45,30,31);cprintf("**mucha suerte**");
getch();
return 0;
}
void marco(int x1,int x2,int y1,int y2)
{int n;
for (n=x1;n<=x2;n++)
{gotoxy(n,y1);printf("Í ");
 gotoxy(n,y2);printf("Í");
}

for (n=y1;n<=y2;n++)
{gotoxy(x1,n);printf("º");
gotoxy(x2,n);printf("º");
}
gotoxy(x2,y1);printf("»");
gotoxy(x1,y2);printf("È");
gotoxy(x2,y2);printf("¼");
gotoxy(x1,y1);printf("É");
return;
getch();
}
void preguntar(int a,int b,int c,int d,int e)
{
printf("%d%d%d%d%d",&a,&b,&c,&d,&e);
}



2  Programación / Programación C/C++ / Re: ola tengo que hacer el juegoo de mente maestra en lenguaje c .(turbo c ++) en: 2 Diciembre 2011, 02:07 am
mira ya tengo el codigo solo que tiene unos errores que me repite los numeros y ya no se que hacer!!! ya busq en google...
3  Programación / Programación C/C++ / ola tengo que hacer el juegoo de mente maestra en lenguaje c .(turbo c ++) en: 2 Diciembre 2011, 01:45 am
ola tengo que hacer un programa del juego de mente maestra en lenguaje c ++ (turbo c++) y no se como haserlo alguien que me ayude x favorr
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines