Juego X 0 C++
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>//-----------------------------------------------------------------------
main(){
srand( time (NULL) );
int resp=1;
int cont0=0, contx=0;
while(resp==1){
clrscr();
/*********************************************************************************************/char nombre[10];
int c=0, j=0,c2=0;
int opcion1=0, opcion2=0;
int cont=0,l=0;
char x[10]={'1','2','3','4','5','6','7','8','9'};
int opcion=0;
int y[10]={'0','0','0','0','0','0','0','0','0'};int ganador=0,v=0;
char d[1];
opcion1=0;
ganador=0;
/**************************************************************************************************/while(((opcion<1)||(opcion>9))&&(ganador==0)){
clrscr();
l++;
gotoxy(28,1);printf("********************";
gotoxy(28,2);printf("* BIENVENIDO A X-0 *";
gotoxy(28,3);printf("********************";
if (cont==0){gotoxy(1,4);printf("Ingrese su nombre[ ]";
gotoxy(20,4);scanf("%s",nombre);
cont++;
}
if((l%2)!=0){
gotoxy(1,1);printf("Turno de %s",nombre);
}else{
gotoxy(1,1);printf("Turno de Oponente";}gotoxy(1,23);printf("Victorias de %s =%d", nombre,contx);
gotoxy(40,23);printf("Victorias del Oponente =%d",contx);
if (v==1){
gotoxy(9,5);printf("<<<--ERROR: Ingrese numeros de los queaparecen en pantalla-->>>";
v=0;
}
gotoxy(60,1);printf("Jugador[1]: %s",nombre);
gotoxy(60,2);printf("Jugador[2]: Oponente..";
for(c=30;c<=45;c++){
gotoxy(c,12);printf("_";gotoxy(c,14);printf("_";
}
for(c=10;c<=17;c++){
gotoxy(35,c);printf(":";
gotoxy(40,c);printf(":";
}
j=-1;
for(c2=11;c2<=15;c2+=2){
for(c=33;c<=43;c+=5){
j++;gotoxy(c,c2);printf("%c",x[j]);
}
}
c2=0; repetir:
if ((l%2)!=0){
if(c2>0){gotoxy(1,20);printf("Ese numero ya esta usado...Reingresa";}c2=0;
gotoxy(1,19);printf("Esbriba el numero donde desea ingresar una X [ ]";...
Regístrate para leer el documento completo.