Advertisement
ripper2hl

Juego de Damas en C++

Jun 11th, 2012
7,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 42.21 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream>
  3. #define T 8
  4. using namespace std ;
  5.    char tablero[T][T];//DEFINE TABLERO
  6.     char blanco=178;//REPRESENTA  LOS CUADROS BLANCO DEL TABLERO
  7.     char negro=177;//REPRESENTA LSO CUADROS NEGROS DEL TABLERO
  8.     int i, j;// J E I SIRVE PARA RELLENAR TABLERO E IMPRIMIRLO ADEMAS DE SERVIR TAMBIEN EN VOID PRESENTACION
  9.     int z; //  ESP PARA COORDENADAS VERTICALES
  10.     int turno=1;//TURNO PARA FICHAS X CUADNO CUANDO UN SUARIO MUEVE UNA FICHA EL TURNO CAMBIA A 0 Y PROSIGUE EL SIGUIENTE JUGADOR
  11.     int direccion ;//INDICA HACIA DODNE QUIERE MOVER LA FICAH EL USUARIO
  12.    int error ; //VALIDACION DE CUANDO COMES UNA FICHA EN DIAGONAL DE LA QUE VAS A COMER
  13.    int contador=1; //SIRVE PARA VOI PRESENTACION
  14.    int fichao=12;
  15.    int fichax=12;// SIRVE PARA DETERMINAR CUANDO SE GANA O PIERDE UN JUEGO
  16.    int terminar=1;
  17.    int contador_fichas_x= 7;//CINTADOR POR DEFAULT SI NO SE CAMBIA OPCIONE EN MODO ESPECIAL
  18.    int contador_fichas_o= 7;
  19.    int x,y ;// PARA MOVER FICHAS
  20.    int contadorcpu;
  21.    void presentacion()
  22. {
  23.  
  24. for(int i=0;i<8;i++){
  25.           cout<<endl;
  26.           contador--;
  27.           cout<<"\t\t\t  " ;
  28.           for(int j=0;j<8;j++){
  29.                 contador++;
  30.                 if(contador%2!=0){
  31.                            cout<<blanco<<blanco<<blanco<<blanco;
  32.                            }
  33.                 if(contador%2==0){
  34.                            cout<<negro<<negro<<negro<<negro;
  35.                            }
  36.                 }
  37.           }
  38. }//FIN VOID PRESENTACION
  39.  
  40.  
  41. void rellenar()//*************************************************************************************************************************
  42. {
  43.   for(i=0;i<T;i++)
  44.   {
  45.   for(j=0;j<T;j++)
  46.   {
  47.  
  48.  if(i<=2&&((j+i)%2==0))
  49.  {tablero[i][j] = 'O' ;
  50.  } // ESTE IF PONE FICHAS CONTRARIAS CUANDO ARREGLO VALGA 0
  51.  
  52.  
  53.  
  54.   else if (i>=5&&((j+i)%2==0) ){
  55.  tablero[i][j] = 'X' ;
  56.                                 }//
  57.  else {
  58.  tablero[i][j] = ' ' ;}
  59. }/*FIN FOR J */  //SALTO DE LINEA
  60. }//FIN FOR I
  61.  
  62. }// FIN DEL VOID RELLENAR E IMPRIMIR
  63. void mover1()//*************************************************************************************************
  64. {
  65. do
  66. {
  67. do
  68. {
  69. do
  70. {
  71. do
  72. {
  73. cout<<"TURNO JUGADOR 2 FICHAS O" <<endl ;
  74.    
  75.    cout<<"INGRESE CORDENADA VERTICAL "<<endl ;
  76.    cin>> x ;
  77.  
  78.    cout<<"INGRESE COORDENADA HORIZONTAL "<<endl ;
  79.     cin>> y;
  80.    
  81.     if  (tablero[x][y]!='O'&&tablero[x][y]!='C')
  82.     {
  83.     cout<<"ERROR VUELVA A TIRAR NO HAY FICHA EN LA CASILLA "<<x<<"-"<<y<<endl ;}
  84. }while (tablero[x][y]!='O'&&tablero[x][y]!='C');//VALIDACION PARA EL TIRO DE MOVIMIENTO
  85.  
  86. do
  87. {
  88.   if (tablero[x][y] == 'O')
  89.   {
  90.   cout<<"SELECCIONE LA NUEVA POSICION DE LA FICHA [1]IZQUIERDA-ABAJO [2] DERECHA-ABAJO "<<endl ;
  91.   cin>>direccion ;
  92.   error=0;
  93.   if(direccion>2||direccion<1)
  94. {
  95.                               cout<<"ERROR ESCOGA UNA OPCION VALIDA EN DIRECCION "<<endl;}
  96.  
  97. if((y==0&&direccion==1)||(y==7&&direccion==2))
  98. {
  99. cout<<"ERROR LA PIEZA SALE DEL TABLERO "<<endl ;
  100. }
  101. }//FIN IF DE MOVIMIENTO
  102.  
  103.  if (tablero[x][y]=='C')
  104. {
  105.   cout<<"SELECCIONE [1]IZQ-ABAJO [2]DER-ABAJO [3]IZQ-ARRIBA [4]DER-ARRIBA "<<endl ;
  106.   cin>>direccion ;
  107.   error=0;
  108.   if(direccion>4||direccion<1)
  109. {cout<<"ERROR ESCOGA UNA OPCION VALIDA EN DIRECCION "<<endl;}
  110. if((y==7&&direccion==2)||(y==0&&direccion==1)||(y==7&&direccion==4)||(y==0&&direccion==3)||(x==0&&direccion==4)||(x==0&&direccion==3)||(x==7&&direccion==1)||(x==7&&direccion==2))
  111. {
  112. cout<<"ERROR NO PUEDES SALIRTE DEL TABLERO "<<endl ;}
  113.  
  114. }//FIN IF DE MOVIMIENTO
  115. }while (direccion>4||direccion<1);
  116. }while ((y==7&&direccion==2)||(y==0&&direccion==1)||(y==7&&direccion==4)||(y==0&&direccion==3)||(x==0&&direccion==4)||(x==0&&direccion==3)||(x==7&&direccion==1)||(x==7&&direccion==2));
  117.  if (direccion == 1 &&( tablero[x+1][y-1]== 'O'||tablero[x+1][y-1]== 'C') ){
  118. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA  "<<endl ;
  119.   }
  120.  
  121.  if (direccion == 2 && (tablero[x+1][y+1]== 'O' || tablero[x+1][y+1]== 'C') ){
  122. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA "<<endl ;
  123.   }
  124.   if (direccion == 3 && (tablero[x-1][y-1]== 'O' || tablero[x-1][y-1]== 'C') ){
  125. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA "<<endl ;
  126.   }
  127.    if (direccion == 4 && (tablero[x-1][y+1]== 'O' || tablero[x-1][y+1]== 'C') ){
  128. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA "<<endl ;
  129.   }
  130.  
  131. }while((direccion == 1 &&( tablero[x+1][y-1]== 'O'||tablero[x+1][y-1]== 'C') )||(direccion == 2 && (tablero[x+1][y+1]== 'O' || tablero[x+1][y+1]== 'C') )|| (direccion == 3 && (tablero[x-1][y-1]== 'O' || tablero[x-1][y-1]== 'C') )||(direccion == 4 && (tablero[x-1][y+1]== 'O' || tablero[x-1][y+1]== 'C') ));//VALIDACION PARA CASILLA OCUPADA POR UNA AMIGA
  132.    if (direccion==1 &&( tablero[x+1][y-1] == 'X' || tablero[x+1][y-1] == 'D') )
  133.   {
  134.   if(y==1)
  135.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  136.   error=1;
  137.   }
  138.   if(x==6)
  139.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  140.   error=1;
  141.   }
  142.   if(tablero[x+2][y-2] == 'X')
  143.   {
  144.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<x+2<<"-"<<y-2<<endl;
  145.    error=1;}
  146.   if(tablero[x+2][y-2] == 'O')
  147.   {
  148.    cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<x+2<<"-"<<y-2<<endl;
  149.    error=1;}
  150.     if(tablero[x+2][y-2] == 'C')
  151.   {
  152.    cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<x+2<<"-"<<y-2<<endl;
  153.    error=1;}
  154.     if(tablero[x+2][y-2] == 'D')
  155.   {
  156.    cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<x+2<<"-"<<y-2<<endl;
  157.    error=1;}
  158.  }
  159.   if (direccion==2 && (tablero[x+1][y+1] == 'X'||tablero[x+1][y+1] == 'D'))
  160.   {
  161.   if(y==6)
  162.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  163.   error=1;
  164.   }
  165.   if(x==6)
  166.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  167.   error=1;
  168.   }
  169.   if(tablero[x+2][y+2] == 'X')
  170.   {
  171.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  172.    error=1;}
  173.   if( tablero[x+2][y+2] == 'O')
  174.   {
  175.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  176.    error=1;}
  177.     if( tablero[x+2][y+2] == 'C')
  178.   {
  179.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  180.    error=1;}
  181.     if( tablero[x+2][y+2] == 'D')
  182.   {
  183.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  184.    error=1;}
  185.  }
  186.  if (direccion==3 && (tablero[x-1][y-1] == 'X'||tablero[x-1][y-1] == 'D'))
  187.   {
  188.   if(y==1)
  189.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  190.   error=1;
  191.   }
  192.   if(x==1)
  193.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  194.   error=1;
  195.   }
  196.   if(tablero[x-2][y-2] == 'X')
  197.   {
  198.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  199.    error=1;}
  200.   if( tablero[x-2][y-2] == 'O')
  201.   {
  202.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  203.    error=1;}
  204.    if( tablero[x-2][y-2] == 'C')
  205.   {
  206.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  207.    error=1;}
  208.    if( tablero[x-2][y-2] == 'D')
  209.   {
  210.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  211.    error=1;}
  212.  }
  213.   if (direccion==4 && (tablero[x-1][y+1] == 'X'||tablero[x-1][y+1] == 'D'))
  214.   {
  215.   if(y==6)
  216.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  217.   error=1;
  218.   }
  219.   if(x==1)
  220.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  221.   error=1;
  222.   }
  223.   if(tablero[x-2][y+2] == 'X')
  224.   {
  225.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  226.    error=1;}
  227.   if( tablero[x-2][y+2] == 'O')
  228.   {
  229.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  230.    error=1;}
  231.    if( tablero[x-2][y+2] == 'D')
  232.   {
  233.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  234.    error=1;}
  235.    if( tablero[x-2][y+2] == 'C')
  236.   {
  237.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x+2<<"-"<<y+2<<endl;
  238.    error=1;}
  239.  }
  240.   }while(error==1);
  241. //VALIDACION DE MOVIMIENTO PARA ESPACION OCUPADOS
  242.  
  243. if (tablero[x][y]=='C' && direccion == 1 && tablero[x+1][y-1]== ' ' ){
  244.    tablero[x][y]=' ' ;
  245.   tablero[x+1][y-1] = 'C' ;
  246.   }
  247. else if (tablero[x][y]=='C' && direccion == 2 && tablero[x+1][y+1]== ' '  ){
  248.      tablero[x][y]=' ' ;
  249.   tablero[x+1][y+1] = 'C' ;
  250.   }
  251.   else if (tablero[x][y]=='C' && direccion == 3 && tablero[x-1][y-1]== ' '  ){
  252.      tablero[x][y]=' ' ;
  253.   tablero[x-1][y-1] = 'C' ;
  254.   }
  255.   else if (tablero[x][y]=='C' && direccion == 4 && tablero[x-1][y+1]== ' '  ){
  256.      tablero[x][y]=' ' ;
  257.   tablero[x-1][y+1] = 'C' ;
  258.   }
  259.   else if(tablero[x][y]=='C' && direccion== 1 && (tablero [x+1][y-1] == 'X'||tablero [x+1][y-1] == 'D'))
  260.   {
  261.   tablero[x][y]=' ' ;
  262.   tablero[x+1][y-1]=' ' ;
  263.   tablero[x+2][y-2]= 'C' ;
  264.     cout<<"\a";
  265.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x+1<<"-"<<y-1 ;
  266.    fichax=fichax-1;
  267.   contador_fichas_o= contador_fichas_o+3;
  268.   getche ();
  269.   }
  270.  else if(tablero[x][y]=='C' && direccion== 2 && (tablero [x+1][y+1] == 'X'||tablero [x+1][y+1] == 'D'))
  271.   {
  272.   tablero[x][y]=' ' ;
  273.   tablero[x+1][y+1]=' ' ;
  274.   tablero[x+2][y+2]= 'C' ;
  275.     cout<<"\a";
  276.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x+1<<"-"<<y+1 ;
  277.    fichax=fichax-1;
  278.   contador_fichas_o= contador_fichas_o+3;
  279.   getche ();
  280.   }
  281.  else if(tablero[x][y]=='C' && direccion== 3 && (tablero [x-1][y-1] == 'X'||tablero [x-1][y-1] == 'D'))
  282.   {
  283.   tablero[x][y]=' ' ;
  284.   tablero[x-1][y-1]=' ' ;
  285.   tablero[x-2][y-2]= 'C' ;
  286.     cout<<"\a";
  287.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x-1<<"-"<<y-1 ;
  288.    fichax=fichax-1;
  289.   contador_fichas_o= contador_fichas_o+3;
  290.   getche ();
  291.   }
  292.   else if(tablero[x][y]=='C' && direccion== 4 && (tablero [x-1][y+1] == 'X'||tablero [x-1][y+1] == 'D'))
  293.   {
  294.   tablero[x][y]=' ' ;
  295.   tablero[x-1][y+1]=' ' ;
  296.   tablero[x-2][y+2]= 'C' ;
  297.     cout<<"\a";
  298.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x-1<<"-"<<y+1 ;
  299.    fichax=fichax-1;
  300.   contador_fichas_o= contador_fichas_o+3;
  301.   getche ();
  302.   }
  303.  else if (tablero[x][y]=='O' && direccion == 1 && tablero[x+1][y-1]== ' ' ){
  304.    tablero[x][y]=' ' ;
  305.   tablero[x+1][y-1] = 'O' ;
  306.   }
  307.   if (tablero[x][y]=='O' && direccion == 2 && tablero[x+1][y+1]== ' ' ){
  308.    tablero[x][y]=' ' ;
  309.   tablero[x+1][y+1] = 'O' ;
  310.   }
  311.  else if(tablero[x][y]=='O'&& direccion== 1 && (tablero [x+1][y-1] == 'X'||tablero [x+1][y-1] == 'D'))
  312.   {
  313.   tablero[x][y]=' ' ;
  314.   tablero [x+1][y-1]= ' ' ;
  315.   tablero[x+2][y-2]= 'O' ;
  316.     cout<<"\a";
  317.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA  "<<x+1<<"-"<<y-1 ;
  318.    fichax=fichax-1;
  319.    contador_fichas_o= contador_fichas_o+3;
  320.   getche ();
  321.   }
  322. else if(tablero[x][y]=='O'&& direccion== 2 && ( tablero [x+1][y+1] == 'X'|| tablero [x+1][y+1] == 'D'))
  323.   {
  324.   tablero[x][y]=' ' ;
  325.   tablero[x+1][y+1]=' ' ;
  326.   tablero[x+2][y+2]= 'O' ;
  327.     cout<<"\a";
  328.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x+1<<"-"<<y+1 ;
  329.    fichax=fichax-1;
  330.   contador_fichas_o= contador_fichas_o+3;
  331.   getche ();
  332.   }
  333.   turno = 1 ;
  334.  
  335. }// FIN VOID MOVER *****************************************************************************************************************
  336. void mover2()
  337. {
  338. do
  339. {
  340. do
  341. {
  342. do
  343. {
  344. do
  345. {
  346. cout<<"TURNO JUGADOR 1 FICHAS X" <<endl ;
  347.    if(turno==1 )
  348.    {  
  349.    cout<<"INGRESE CORDENADA VERTICAL "<<endl ;
  350.    cin>> x ;
  351.  
  352.    cout<<"INGRESE COORDENADA HORIZONTAL "<<endl ;
  353.     cin>> y;
  354.     }//FIN IF TURNO =1
  355.     if  (tablero[x][y]!='X'&&tablero[x][y]!='D')
  356.     {
  357.     cout<<"ERROR VUELVA A TIRAR NO HAY FICHA EN LA CASILLA "<<x<<"-"<<y<<endl ;}
  358. }while (tablero[x][y]!='X'&&tablero[x][y]!='D');//VALIDACION PARA EL TIRO DE MOVIMIENTO
  359. do
  360. {
  361.   if (tablero[x][y] == 'X')
  362.   {
  363. {
  364.   cout<<"SELECCIONE LA NUEVA POSICION DE LA FICHA [1]IZQUIERDA-ARRIBA [2] DERECHA-ARRIBA " ;
  365.   cin>>direccion ;
  366.   error=0;
  367.   if(direccion>2||direccion<1)
  368. {cout<<"ERROR ESCOGA UNA OPCION VALIDA EN DIRECCION "<<endl;
  369. }
  370. }
  371. if((y==7&&direccion==2)||(y==0&&direccion==1))
  372. {
  373. cout<<"ERROR NO PUEDES SALIRTE DEL TABLERO "<<endl ;}
  374. }//FIN IF DE MOVIMIENTO
  375.  if (tablero[x][y]=='D')
  376. {
  377.  cout<<"SELECCIONE [1]IZQ-ARRIBA [2]DER-ARRIBA [3]IZQ-ABAJO [4] DER-ABAJO " <<endl ;
  378.  cin>>direccion ;
  379.   error=0;
  380.  if(direccion>4||direccion<1)
  381. {cout<<"ERROR ESCOGA UNA OPCION VALIDA EN DIRECCION "<<endl;}
  382. if((y==7&&direccion==2)||(y==0&&direccion==1)||(y==7&&direccion==4)||(y==0&&direccion==3)||(x==0&&direccion==1)||(x==0&&direccion==2)||(x==7&&direccion==3)||(x==7&&direccion==4))
  383. {
  384. cout<<"ERROR NO PUEDES SALIRTE DEL TABLERO "<<endl ;}
  385. }// fin if
  386. }while (direccion>4||direccion<1);//VALIDACION DE MOVIMIETNO PARA DIRECCION
  387. }while((y==7&&direccion==2)||(y==0&&direccion==1)||(y==7&&direccion==4)||(y==0&&direccion==3)||(x==0&&direccion==1)||(x==0&&direccion==2)||(x==7&&direccion==3)||(x==7&&direccion==4));//Vlidacion para no salirte del tablero
  388.  if (direccion == 1 && ( tablero[x-1][y-1]== 'X'||tablero[x-1][y-1]== 'D')  ){
  389. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA  "<<endl ;
  390.   }
  391.  else if (direccion == 2 && (tablero[x-1][y+1]== 'X'||tablero[x-1][y+1]== 'D') ){
  392. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA "<<endl ;
  393.   }
  394.  else if (direccion == 3 && (tablero[x+1][y-1]== 'X'||tablero[x+1][y-1]== 'D') ){
  395. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA "<<endl ;
  396.   }
  397.  else if (direccion == 4 && (tablero[x+1][y+1]== 'X'||tablero[x+1][y+1]== 'D') ){
  398. cout<<"ERROR LA CASILLA ESTA OCUPADA POR UNA FICHA AMIGA "<<endl ;
  399.   }
  400. }while((direccion==1&&(tablero[x-1][y-1]== 'X'||tablero[x-1][y-1]== 'D'))||(direccion==2&&(tablero[x-1][y+1]== 'X'||tablero[x-1][y+1]== 'D') )||(direccion == 3 && (tablero[x+1][y-1]== 'X'||tablero[x-1][y+1]== 'D') )||(direccion == 4 && (tablero[x+1][y+1]== 'X'||tablero[x+1][y+1]== 'D') ));//VALIDACION DE MOVIMIENTO PARA ESPACION OCUPADO POR
  401. //CASILLA AMIGA  
  402.  if (direccion==1 && (tablero[x-1][y-1] == 'O'||tablero[x-1][y-1] == 'C') )  
  403.   {
  404.   if(y==1)
  405.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  406.   error=1;
  407.   }
  408.   if(x==1)
  409.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  410.   error=1;
  411.   }
  412.   if(tablero[x-2][y-2] == 'X')
  413.   {        
  414.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x-2<<"-"<<y-2<<endl;
  415.   error=1;}
  416.   if(tablero[x-2][y-2] == 'O' )
  417.   {
  418.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x-2<<"-"<<y-2<<endl;
  419.   error=1;}
  420.    if(tablero[x-2][y-2] == 'D' )
  421.   {
  422.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x-2<<"-"<<y-2<<endl;
  423.   error=1;}
  424.    if(tablero[x-2][y-2] == 'C' )
  425.   {
  426.   cout<<"NO SE PUEDE COMER LA FICHA YA QUE HAY OTRA FICHA EN LA CASILLA "<<x-2<<"-"<<y-2<<endl;
  427.   error=1;}
  428.  }
  429.   else if (direccion==2 && (tablero[x-1][y+1] == 'O'||tablero[x-1][y+1] == 'C'))
  430.   {
  431.   if(y==6)
  432.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  433.   error=1;
  434.   }
  435.   if(x==1)
  436.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  437.   error=1;
  438.   }      
  439.   if(tablero[x-2][y+2] == 'X')
  440.   {
  441.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  442.   error=1;}
  443.   if (tablero[x-2][y+2] == 'O')
  444.   {
  445.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  446.   error=1;}
  447.   if (tablero[x-2][y+2] == 'D')
  448.   {
  449.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  450.   error=1;}
  451.   if (tablero[x-2][y+2] == 'C')
  452.   {
  453.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  454.   error=1;}
  455.  }
  456.   else if (direccion==3 && (tablero[x+1][y-1] == 'O'||tablero[x+1][y-1] == 'C'))
  457.   {
  458.   if(y==1)
  459.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;if(y==1)
  460.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  461.   error=1;
  462.   }
  463.   error=1;
  464.   }
  465.   if(x==6)
  466.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  467.   error=1;
  468.   }
  469.   if(tablero[x+2][y-2] == 'X')
  470.   {
  471.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  472.   error=1;}
  473.   if (tablero[x+2][y-2] == 'O')
  474.   {
  475.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  476.   error=1;}
  477.   if (tablero[x-2][y+2] == 'C')
  478.   {
  479.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  480.   error=1;}
  481.   if (tablero[x-2][y+2] == 'D')
  482.   {
  483.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  484.   error=1;}
  485.  }
  486.   else if (direccion==4 && (tablero[x+1][y+1] == 'O'||tablero[x+1][y+1] == 'C'))
  487.   {
  488.   if(y==6)
  489.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  490.   error=1;
  491.   }
  492.   if(x==6)
  493.   {cout<<"ERROR TE SALES DEL TABLERO "<<endl ;
  494.   error=1;
  495.   }
  496.   if(tablero[x+2][y+2] == 'X')
  497.   {
  498.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  499.   error=1;}
  500.   if (tablero[x+2][y+2] == 'O')
  501.   {
  502.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  503.   error=1;}
  504.    if (tablero[x+2][y+2] == 'D')
  505.   {
  506.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  507.   error=1;}
  508.    if (tablero[x+2][y+2] == 'C')
  509.   {
  510.   cout<<"ERROR NO SE PUEDE COMER UNA FICHA YA QUE LA POSICION ESTA OCUPADA "<<endl;
  511.   error=1;}
  512.  }
  513. }while(error==1);
  514. //VALIDACION DE MOVIMIENTO PARA ESPACION OCUPADOS CUANDO SE VA A COMER
  515. if(tablero[x][y]== 'D' && direccion==1 && tablero[x-1][y-1]== ' '  ){
  516.  tablero[x][y]= ' ';
  517.  tablero[x-1][y-1]= 'D';}
  518.  else if (tablero[x][y]=='D'&& direccion == 2 && tablero[x-1][y+1]== ' ' ){
  519.    tablero[x][y]=' ' ;
  520.   tablero[x-1][y+1] = 'D' ;
  521.   }
  522.   else if (tablero[x][y]=='D'&& direccion == 3 && tablero[x+1][y-1]== ' ' ){
  523.    tablero[x][y]=' ' ;
  524.   tablero[x+1][y-1] = 'D' ;
  525.   }
  526.   else if (tablero[x][y]=='D'&& direccion == 4 && tablero[x+1][y+1]== ' ' ){
  527.    tablero[x][y]=' ' ;
  528.   tablero[x+1][y+1] = 'D' ;
  529.   }
  530.    else if(tablero[x][y]=='D'&& direccion== 1 &&( tablero [x-1][y-1] == 'O' || tablero [x-1][y-1] == 'C'))
  531.   {
  532.   tablero[x][y]=' ' ;
  533.   tablero[x-1][y-1]=' ' ;
  534.   tablero[x-2][y-2]= 'D' ;
  535.   cout<<"\a";
  536.   cout<<"HAS COMIDO A LA FICHA CONTRARIA 'O' EN LA CASILLA "<<x-1<<"-"<<y-1 ;
  537.   fichao=fichao-1;
  538.   contador_fichas_x= contador_fichas_x+3;
  539.   getche ();
  540.   }
  541.      else if(tablero[x][y]=='D'&& direccion==2 && (tablero [x-1][y+1] == 'O'||tablero [x-1][y+1] == 'C'))
  542.   {
  543.   tablero[x][y]=' ' ;
  544.   tablero[x-1][y+1]=' ' ;
  545.   tablero[x-2][y+2]= 'D' ;
  546.   cout<<"\a";
  547.   cout<<"HAS COMIDO A LA FICHA CONTRARIA 'O' EN LA CASILLA  "<<x-1<<"-"<<y+1 ;
  548.   fichao=fichao-1;
  549.   contador_fichas_x= contador_fichas_x+3;
  550.   getche ();
  551.   }
  552.      else if(tablero[x][y]=='D'&& direccion== 3 && (tablero [x+1][y-1] == 'O'||tablero [x+1][y-1] == 'C'))
  553.   {
  554.   tablero[x][y]=' ' ;
  555.   tablero[x+1][y-1]=' ' ;
  556.   tablero[x+2][y-2]= 'D' ;
  557.   cout<<"\a";
  558.   cout<<"HAS COMIDO A LA FICHA CONTRARIA 'O' EN LA CASILLA "<<x+1<<"-"<<y-1 ;
  559.   fichao=fichao-1;
  560.   contador_fichas_x= contador_fichas_x+3;
  561.   getche ();
  562.   }
  563.      else if(tablero[x][y]=='D'&& direccion== 4 && (tablero [x+1][y+1] == 'O'||tablero [x+1][y-1] == 'C'))
  564.   {
  565.   tablero[x][y]=' ' ;
  566.   tablero[x+1][y+1]=' ' ;
  567.   tablero[x+2][y+2]= 'D' ;
  568.   cout<<"\a";
  569.   cout<<"HAS COMIDO A LA FICHA CONTRARIA 'O' EN LA CASILLA "<<x+1<<"-"<<y+1 ;
  570.   fichao=fichao-1;
  571.   contador_fichas_x= contador_fichas_x+3;
  572.   getche ();}
  573.     else if(tablero[x][y]== 'X' && direccion== 1 && tablero [x-1][y-1] == ' ')
  574.   {
  575.   tablero[x][y]=' ' ;
  576.   tablero [x-1][y-1]= 'X' ;  
  577.   }//FIN DE ELSE IF
  578.  else if(tablero[x][y]=='X'&& direccion== 1 && (tablero [x-1][y-1] == 'O'||tablero [x-1][y-1] == 'C'))
  579.   {
  580.   tablero[x][y]=' ' ;
  581.   tablero[x-1][y-1]=' ' ;
  582.   tablero[x-2][y-2]= 'X' ;
  583.   cout<<"\a";
  584.   cout<<"HAS COMIDO A LA FICHA CONTRARIA 'O' EN LA CASILLA  "<<x-1<<"-"<<y-1 ;
  585.   fichao=fichao-1;
  586.   contador_fichas_x= contador_fichas_x+3;
  587.   getche ();
  588.   }
  589.   else if(tablero[x][y]== 'X' && direccion== 2 && tablero [x-1][y+1] == ' ')
  590.   {
  591.   tablero[x][y]=' ' ;
  592.   tablero [x-1][y+1]= 'X' ;  
  593.   }//FIN DE ELSE IF
  594.    else if(tablero[x][y]== 'X' && direccion== 2 && (tablero [x-1][y+1] == 'O'||tablero [x-1][y+1] == 'C'))
  595.   {
  596.   tablero[x][y]=' ' ;
  597.   tablero [x-1][y+1]= ' ' ;
  598.   tablero[x-2][y+2]= 'X' ;
  599.     cout<<"\a";
  600.   cout<<"HAS COMIDO A LA FICHA CONTRARIA 'O' EN LA CASILLA "<<x-1<<"-"<<y+1 ;
  601.     fichao=fichao-1;
  602.   contador_fichas_x= contador_fichas_x+3;
  603.   getche();
  604.   }//FIN DE ELSE IF
  605.    turno = 0 ;  
  606. }//FIN VOI MOVER 2   *****************************************************************************************************************+  
  607. void imprimir()
  608. {
  609.        for(z=0;z<T;z++)
  610.   {//INICIO DEL FOR Z QUE SIRVE PARA INDICAR LAS CORDENADAS HORIZONTALES
  611.   cout<<z<<"    ";}//FIN DEL FOR Z
  612.   cout<<endl;
  613.  for(i=0;i<T;i++)
  614.   {
  615.    cout<<"\t\t       ";
  616.    cout<<i;//ESTA I SIRVE PARA INDICAR COORDENADAS VERTICALES
  617.   for(j=0;j<T;j++)
  618.   {
  619.  if((tablero[i][j]=='X'||tablero[i][j]=='O'||tablero[i][j]=='C'||tablero[i][j]=='D')&&((j+i)%2==0))
  620.  {
  621.  cout<<blanco<<blanco<<tablero[i][j]<<blanco<<blanco; }
  622. else if (tablero[i][j]==' ' && (j+i)%2!=0)
  623.  {
  624.  cout<<negro<<negro<<negro<<negro<<negro;}
  625. else if (tablero[i][j]==' ' &&(j+i)%2==0)
  626.  {
  627.  cout<<blanco<<blanco<<blanco<<blanco<<blanco; ;}
  628. }/*FIN FOR J */cout<<endl;  //SALTO DE LINEA
  629. }//FIN FOR I
  630.  }// FIN VOID RE IMPRIMIR *****************************************************************************************************************
  631. void cpu ()
  632. {
  633. cout<<"TURNO COMPUTADORA PENSANDO JUGADA...." <<endl ;    
  634. do
  635. {
  636. do
  637. {
  638. do
  639. {
  640. do
  641. {
  642. srand(time(NULL));
  643.  x=rand() % 7+0 ;
  644.  y=rand() % 7+0 ;
  645. }while (tablero[x][y]!='O'&&tablero[x][y]!='C');//VALIDACION PARA EL TIRO DE MOVIMIENTO
  646. do
  647. {
  648.  if (tablero[x][y]=='C')
  649. {
  650. direccion=rand()% 4+1 ;
  651.   error=0;
  652.   if (tablero[x][y] == 'O')
  653.   {
  654. direccion=rand() % 2+1 ;
  655.   error=0;
  656. }//FIN IF DE MOVIMIENTO
  657. }//FIN IF DE MOVIMIENTO
  658. }while (direccion>4||direccion<1);
  659. }while ((y==7&&direccion==2)||(y==0&&direccion==1)||(y==7&&direccion==4)||(y==0&&direccion==3)||(x==0&&direccion==4)||(x==0&&direccion==3)||(x==7&&direccion==1)||(x==7&&direccion==2));
  660. }while((direccion == 1 &&( tablero[x+1][y-1]== 'O'||tablero[x+1][y-1]== 'C') )||(direccion == 2 && (tablero[x+1][y+1]== 'O' || tablero[x+1][y+1]== 'C') )|| (direccion == 3 && (tablero[x-1][y-1]== 'O' || tablero[x-1][y-1]== 'C') )||(direccion == 4 && (tablero[x-1][y+1]== 'O' || tablero[x-1][y+1]== 'C') ));//VALIDACION PARA CASILLA OCUPADA POR UNA AMIGA
  661.    if (direccion==1 &&( tablero[x+1][y-1] == 'X' || tablero[x+1][y-1] == 'D') )
  662.   {
  663.   if(y==1)
  664.   {
  665.   error=1;
  666.   }
  667.   if(x==6)
  668.   {
  669.   error=1;
  670.   }
  671.   if(tablero[x+2][y-2] == 'X')
  672.   {
  673.    error=1;}
  674.   if(tablero[x+2][y-2] == 'O')
  675.   {
  676.    error=1;}
  677.     if(tablero[x+2][y-2] == 'C')
  678.   {
  679.    error=1;}
  680.     if(tablero[x+2][y-2] == 'D')
  681.   {
  682.    error=1;}
  683.  }
  684.  if (direccion==2 && (tablero[x+1][y+1] == 'X'||tablero[x+1][y+1] == 'D'))
  685.   {
  686.   if(y==6)
  687.   {error=1;
  688.   }
  689.   if(x==6)
  690.   { error=1;
  691.   }
  692.   if(tablero[x+2][y+2] == 'X')
  693.   {
  694.    error=1;}
  695.   if( tablero[x+2][y+2] == 'O')
  696.   {
  697.   error=1;}
  698.     if( tablero[x+2][y+2] == 'C')
  699.   {
  700.   error=1;}
  701.     if( tablero[x+2][y+2] == 'D')
  702.   {
  703.    error=1;}
  704.  }
  705.  if (direccion==3 && (tablero[x-1][y-1] == 'X'||tablero[x-1][y-1] == 'D'))
  706.   {
  707.   if(y==1)
  708.   { error=1;
  709.   }
  710.   if(x==1)
  711.   { error=1;
  712.   }
  713.   if(tablero[x-2][y-2] == 'X')
  714.   {
  715.     error=1;}
  716.   if( tablero[x-2][y-2] == 'O')
  717.   {
  718.    error=1;}
  719.    if( tablero[x-2][y-2] == 'C')
  720.   {
  721.    error=1;}
  722.    if( tablero[x-2][y-2] == 'D')
  723.   {
  724.   error=1;}
  725.  }
  726.  if (direccion==4 && (tablero[x-1][y+1] == 'X'||tablero[x-1][y+1] == 'D'))
  727.   {
  728.   if(y==6)
  729.   {error=1;
  730.   }
  731.   if(x==1)
  732.   {error=1;
  733.   }
  734.   if(tablero[x-2][y+2] == 'X')
  735.   {
  736.   error=1;}
  737.   if( tablero[x-2][y+2] == 'O')
  738.   {
  739.    error=1;}
  740.    if( tablero[x-2][y+2] == 'D')
  741.   {
  742.   error=1;}
  743.    if( tablero[x-2][y+2] == 'C')
  744.   {
  745.    error=1;}
  746.  }
  747. }while(error==1);
  748. //VALIDACION DE MOVIMIENTO PARA ESPACION OCUPADOS
  749. if (tablero[x][y]=='C' && direccion == 1 && tablero[x+1][y-1]== ' ' ){
  750.    tablero[x][y]=' ' ;
  751.   tablero[x+1][y-1] = 'C' ;
  752.    cout<<"LA COMPUTADORA A MOVIDO UNA FICHA A LA CASILLA "<<x+1<<"-"<<y-1 ;
  753.    getche ();
  754.   }
  755. else if (tablero[x][y]=='C' && direccion == 2 && tablero[x+1][y+1]== ' '  ){
  756.      tablero[x][y]=' ' ;
  757.   tablero[x+1][y+1] = 'C' ;
  758.    cout<<"LA COMPUTADORA A MOVIDO UNA FICHA A LA CASILLA "<<x+1<<"-"<<y+1 ;
  759.    getche ();
  760.   }
  761.   else if (tablero[x][y]=='C' && direccion == 3 && tablero[x-1][y-1]== ' '  ){
  762.      tablero[x][y]=' ' ;
  763.   tablero[x-1][y-1] = 'C' ;
  764.    cout<<"LA COMPUTADORA A MOVIDO UNA FICHA A LA CASILLA "<<x-1<<"-"<<y-1 ;
  765.    getche ();
  766.   }
  767.   else if (tablero[x][y]=='C' && direccion == 4 && tablero[x-1][y+1]== ' '  ){
  768.      tablero[x][y]=' ' ;
  769.   tablero[x-1][y+1] = 'C' ;
  770.   cout<<"LA COMPUTADORA A MOVIDO UNA FICHA A LA CASILLA "<<x-1<<"-"<<y+1 ;
  771.    getche ();
  772.   }
  773.   else if(tablero[x][y]=='C' && direccion== 1 && (tablero [x+1][y-1] == 'X'||tablero [x+1][y-1] == 'D'))
  774.   {
  775.   tablero[x][y]=' ' ;
  776.   tablero[x+1][y-1]=' ' ;
  777.   tablero[x+2][y-2]= 'C' ;
  778.     cout<<"\a";
  779.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x+1<<"-"<<y-1 ;
  780.    fichax=fichax-1;
  781.   contador_fichas_o= contador_fichas_o+3;
  782.   getche ();
  783.   }
  784.  else if(tablero[x][y]=='C' && direccion== 2 && (tablero [x+1][y+1] == 'X'||tablero [x+1][y+1] == 'D'))
  785.   {
  786.   tablero[x][y]=' ' ;
  787.   tablero[x+1][y+1]=' ' ;
  788.   tablero[x+2][y+2]= 'C' ;
  789.     cout<<"\a";
  790.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x+1<<"-"<<y+1 ;
  791.    fichax=fichax-1;
  792.   contador_fichas_o= contador_fichas_o+3;
  793.   getche ();
  794.   }
  795.  else if(tablero[x][y]=='C' && direccion== 3 && (tablero [x-1][y-1] == 'X'||tablero [x-1][y-1] == 'D'))
  796.   {
  797.   tablero[x][y]=' ' ;
  798.   tablero[x-1][y-1]=' ' ;
  799.   tablero[x-2][y-2]= 'C' ;
  800.     cout<<"\a";
  801.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x-1<<"-"<<y-1 ;
  802.    fichax=fichax-1;
  803.   contador_fichas_o= contador_fichas_o+3;
  804.   getche ();
  805.   }
  806.    else if(tablero[x][y]=='C' && direccion== 4 && (tablero [x-1][y+1] == 'X'||tablero [x-1][y+1] == 'D'))
  807.   {
  808.   tablero[x][y]=' ' ;
  809.   tablero[x-1][y+1]=' ' ;
  810.   tablero[x-2][y+2]= 'C' ;
  811.     cout<<"\a";
  812.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x-1<<"-"<<y+1 ;
  813.    fichax=fichax-1;
  814.   contador_fichas_o= contador_fichas_o+3;
  815.   getche ();
  816.   }
  817.  else if (tablero[x][y]=='O' && direccion == 1 && tablero[x+1][y-1]== ' ' )
  818.  {
  819.    tablero[x][y]=' ' ;
  820.   tablero[x+1][y-1] = 'O' ;
  821.    cout<<"LA COMPUTADORA A MOVIDO UNA FICHA A LA CASILLA "<<x+1<<"-"<<y-1 ;
  822.    getche ();
  823.   }
  824.   if (tablero[x][y]=='O' && direccion == 2 && tablero[x+1][y+1]== ' ' )
  825.   {
  826.    tablero[x][y]=' ' ;
  827.   tablero[x+1][y+1] = 'O' ;
  828.    cout<<"LA COMPUTADORA A MOVIDO UNA FICHA A LA CASILLA "<<x+1<<"-"<<y+1 ;
  829.    getche ();
  830. }
  831.  else if(tablero[x][y]=='O'&& direccion== 1 && (tablero [x+1][y-1] == 'X'||tablero [x+1][y-1] == 'D'))
  832.   {
  833.   tablero[x][y]=' ' ;
  834.   tablero [x+1][y-1]= ' ' ;
  835.   tablero[x+2][y-2]= 'O' ;
  836.     cout<<"\a";
  837.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA  "<<x+1<<"-"<<y-1 ;
  838.    fichax=fichax-1;
  839.    contador_fichas_o= contador_fichas_o+3;
  840.   getche ();
  841.   }
  842. else if(tablero[x][y]=='O'&& direccion== 2 && ( tablero [x+1][y+1] == 'X'|| tablero [x+1][y+1] == 'D'))
  843.   {
  844.   tablero[x][y]=' ' ;
  845.   tablero[x+1][y+1]=' ' ;
  846.   tablero[x+2][y+2]= 'O' ;
  847.     cout<<"\a";
  848.    cout<<"HAS COMIDO A LA FICHA CONTRARIA 'X' EN LA CASILLA   "<<x+1<<"-"<<y+1 ;
  849.    fichax=fichax-1;
  850.   contador_fichas_o= contador_fichas_o+3;
  851.   getche ();
  852.   }
  853.    turno = 1 ;  
  854. }//FIN DEL VOID CPU **********************************************************************************************************************
  855. int main( )
  856. {
  857. int seleccion ;//REPRESENTA LA SELECCION DEL MENU
  858. system("color B") ;
  859. cout<<"\n\n\n\n";
  860.    cout<<"\t     ---------BIENVENIDO AL JUEGO DE DAMAS INGLESAS EN C++--------\n\n\n";
  861.    cout<<"\n                * * * * * * * *   PRESIONA START  * * * * * * * *\n" ;
  862.     presentacion() ;
  863. cout<<"\n\n\n\n";
  864. cout<<"\t\t 2011 copyright \251AsA Todos los Derechos Reservados";
  865.    getche();
  866.    system ("cls");
  867. do
  868. {  
  869. system("color 7");
  870.    cout<<"\t***************BENVENIDO AL JUEGO DE DAMAS EN C++**************\n\n\n";
  871.    cout<<"\t\t\t  MODO NORMAL JUEGO 2-JUGADORES  [1]\n";
  872.    cout<<"\t\t\t  MODO ESPECIAL  [2]\n";
  873.    cout<<"\t\t\t  CONTRA COMPUTADORA [3]\n ";
  874.    cout<<"\t\t\t  LEER MANUAL [4]\n ";
  875.    cout<<"\t\t\t  OPCIONES [5]\n ";
  876.    cout<<"\t\t\t  SALIR [6]"<<endl;
  877.   cin>>seleccion;
  878.   system("CLS");
  879.   switch (seleccion)
  880.   {
  881.   case 1://**********************************************************************************************************************************
  882.   {
  883.    cout<<"\t\t         ";
  884.   system("color 0E") ;
  885. rellenar();
  886. imprimir() ;
  887. do
  888. {
  889. for(i=0;i<T;i++)
  890. {
  891. for(j=0;j<T;j++)
  892. {
  893. if (tablero[i][j]=='D' && tablero[i+2][j+2]==' ' && (tablero[i+1][j+1]=='O'||tablero[i+1][j+1]=='C') && j!= 6)
  894. {
  895. cout<<"TU OPONENTE TE OBLIGO A COMER AUTOMATICAMENTE LA FICHA EN "<<i+1<<"-"<<j+1<<endl;
  896. tablero[i][j]=' ';
  897. tablero[i+1][j+1]= ' ';
  898. tablero[i+2][j+2]='D' ;
  899. getche();
  900. fichao=fichao-1;
  901. turno=0;}
  902. else if (tablero[i][j]=='D' && tablero[i+2][j-2]==' ' && (tablero[i+1][j-1]=='O'||tablero[i+1][j-1]=='C') && j!= 1)
  903. {
  904. cout<<"TU OPONENTE TE OBLIGO A COMER AUTOMATICAMENTE LA FICHA EN "<<i+1<<"-"<<j-1<<endl;
  905. tablero[i][j]=' ';
  906. tablero[i+1][j-1]= ' ';
  907. tablero[i+2][j-2]='D' ;
  908. getche();
  909. fichao=fichao-1;
  910. turno=0;}      
  911. else if (tablero[i][j]=='D' && tablero[i-2][j+2]==' ' && (tablero[i-1][j+1]=='O'||tablero[i-1][j+1]=='C')  && j!= 6)
  912. {
  913. cout<<"TU OPONENTE TE OBLIGO A COMER AUTOMATICAMENTE LA FICHA EN "<<i-1<<"-"<<j+1<<endl;
  914. tablero[i][j]=' ';
  915. tablero[i-1][j+1]= ' ';
  916. tablero[i-2][j+2]='D' ;
  917. getche();
  918. fichao=fichao-1;
  919. turno=0;}      
  920. else if(tablero[i][j]=='D'&& tablero[i-2][j-2]==' ' && (tablero[i-1][j-1]=='O'||tablero[i-1][j-1]=='C') && j!= 1 )
  921. {
  922. cout<<"TU OPONENTE TE OBLIGO A COMER AUTOMATICAMENTE LA FICHA EN "<<i-1<<"-"<<j-1<<endl;
  923. tablero[i][j]=' ';
  924. tablero[i-1][j-1]= ' ';
  925. tablero[i-2][j-2]='D' ;
  926. getche();
  927. fichao=fichao-1;
  928. turno=0;}        
  929. else if(tablero[i][j]=='X'&& tablero[i-2][j-2]==' ' && (tablero[i-1][j-1]=='O'||tablero[i-1][j-1]=='C') && j!= 1  )
  930. {
  931. cout<<"TU OPONENTE TE OBLIGO A COMER AUTOMATICAMENTE LA FICHA EN "<<i-1<<"-"<<j-1<<endl;
  932. tablero[i][j]=' ';
  933. tablero[i-1][j-1]= ' ';
  934. tablero[i-2][j-2]='X' ;
  935. getche();
  936. fichao=fichao-1;
  937. turno=0;}
  938. else if (tablero[i][j]=='X' && tablero[i-2][j+2]==' ' && (tablero[i-1][j+1]=='O'||tablero[i-1][j+1]=='C') && j!= 6 )
  939. {
  940. cout<<"TU OPONENTE TE OBLIGO A COMER AUTOMATICAMENTE LA FICHA EN "<<i-1<<"-"<<j+1<<endl;
  941. tablero[i][j]=' ';
  942. tablero[i-1][j+1]= ' ';
  943. tablero[i-2][j+2]='X' ;
  944. getche();
  945. fichao=fichao-1;
  946. turno=0;}
  947. }
  948. }
  949. if(turno==1)
  950. {    
  951. mover2();}
  952.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  953. {
  954. if(tablero[0][x]== 'X' )
  955. {
  956. tablero[0][x]='D';
  957. cout<<"TU FICHA SE A CONVERTIDO EN DAMA SE USARA LA LETRA -D- PARA REPRESENTARLA "<<endl ;
  958. getche();
  959. }
  960. }// FIN DE DAMAS
  961. system("CLS");
  962. cout<<"\t\t         ";
  963. imprimir() ;
  964. if (fichao==0)
  965.     {
  966.     cout<<"JUEGO TERMINADO JUGADOR UNO A GANADO ESTA PARTIDA  " <<endl;
  967.     terminar=2;
  968.     break;
  969. }
  970. for(i=0;i<T;i++)
  971. {
  972. for(j=0;j<T;j++)
  973. {
  974. if(tablero[i][j]=='C'&& tablero[i+2][j+2]==' ' && (tablero[i+1 ][j+1]=='X'||tablero[i+1 ][j+1]=='D') && j!=1)
  975. {
  976. cout<<"SE COMIO AUTOMATICAMENTE LA FICHA EN "<<i+1<<"-"<<j+1<<endl;
  977. tablero[i][j]=' ';
  978. tablero[i+1][j+1]= ' ';
  979. tablero[i+2][j+2]='C' ;
  980. getche();
  981. fichax=fichax-1;
  982. turno=1;}
  983. if (tablero[i][j]=='C' && tablero[i-2 ][j-2]==' ' && ( tablero[i-1][j-1]=='X'||tablero[i-1][j-1]=='D') && j!=1)
  984. {
  985. cout<<"SE COMIO AUTOMATICAMENTE LA FICHA EN "<<i-1<<"-"<<j-1<<endl;
  986. tablero[i][j]=' ';
  987. tablero[i-1][j-1]= ' ';
  988. tablero[i-2][j-2]='C' ;
  989. getche();
  990. fichax=fichax-1;
  991. turno=1;}
  992. else if (tablero[i][j]=='C' && tablero[i-2][j+2]==' ' && (tablero[i-1][j+1]=='X'||tablero[i-1][j+1]=='D') && j!=6  )
  993. {
  994. cout<<"SE COMIO AUTOMATICAMENTE LA FICHA EN "<<i-1<<"-"<<j+1<<endl;
  995. tablero[i][j]=' ';
  996. tablero[i-1][j+1]= ' ';
  997. tablero[i-2][j+2]='C' ;
  998. getche();
  999. fichax=fichao-1;
  1000. turno=1;}
  1001. else if (tablero[i][j]=='C' && tablero[i+2][j-2]==' ' && (tablero[i+1][j-1]=='X'||tablero[i+1][j-1]=='D') && j!=6)
  1002. {
  1003. cout<<"SE COMIO AUTOMATICAMENTE LA FICHA EN "<<i+1<<"-"<<j-1<<endl;
  1004. tablero[i][j]=' ';
  1005. tablero[i+1][j-1]= ' ';
  1006. tablero[i+2][j-2]='C' ;
  1007. getche();
  1008. fichax=fichax-1;
  1009. turno=1;}
  1010. else if(tablero[i][j]=='O'&& tablero[i+2][j+2]==' ' &&( tablero[i+1][j+1]=='X'||tablero[i+1][j+1]=='D') && j!=6)
  1011. {
  1012. cout<<"SE COMIO AUTOMATICAMENTE LA FICHA EN "<<i+1<<"-"<<j+1<<endl;
  1013. tablero[i][j]=' ';
  1014. tablero[i+1][j+1]= ' ';
  1015. tablero[i+2][j+2]='O' ;
  1016. getche();
  1017. fichax=fichax-1;
  1018. turno=1;}
  1019. else if (tablero[i][j]=='O' && tablero[i+2 ][j-2 ]==' ' && (tablero[i+1][j-1]=='X' ||tablero[i+1][j-1]=='D' ) && j!=1)
  1020. {            
  1021. cout<<"SE COMIO AUTOMATICAMENTE LA FICHA EN "<<i+1<<"-"<<j-1<<endl;
  1022. tablero[i][j]=' ';
  1023. tablero[i+1][j-1]= ' ';
  1024. tablero[i+2][j-2]='O' ;
  1025. getche();
  1026. fichax=fichax-1;
  1027. turno=1;}
  1028. }
  1029. }
  1030. if(turno==0)
  1031. {
  1032. mover1();}
  1033.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1034. {
  1035. if(tablero[7][x]== 'O' )
  1036. {
  1037. tablero[7][x]='C';
  1038. cout<<"TU FICHA SE A CONVERTIDO EN DAMA SE USARA LA LETRA -C- PARA REPRESENTARLA "<<endl ;
  1039. getche();
  1040. }
  1041. }// FIN DE DAMAS
  1042. system("CLS");
  1043. cout<<"\t\t         ";
  1044.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1045. {
  1046. if(tablero[7][x]== 'O' )
  1047. {
  1048. tablero[7][x]='C';
  1049. }
  1050. }// FIN DE DAMAS
  1051. imprimir() ;
  1052.  if(fichax==0){
  1053.      cout<<"JUEGO TERMINADO JUGADOR DOS A GANADO ESTA PARTIDA "<<endl;
  1054.      terminar=2;
  1055.      break;
  1056.      }
  1057. }while(terminar==1);
  1058. break;
  1059. }//COMENZAR JUEGO**************************************************************************************************************************
  1060. case 2 :
  1061. {
  1062.        cout<<"\t\t         ";
  1063.   system("color F") ;
  1064. rellenar();
  1065. imprimir() ;
  1066. do
  1067. {
  1068. if (turno==1)
  1069. {        
  1070. mover2();}
  1071. contador_fichas_x= contador_fichas_x-1;
  1072. cout<<"JUGADOR 1 LE QUEDAN "<<contador_fichas_x<<" TURNOS "<<endl;
  1073. getche();
  1074.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1075. {
  1076. if(tablero[0][x]== 'X' )
  1077. {
  1078. tablero[0][x]='D';
  1079. cout<<"TU FICHA SE A CONVERTIDO EN DAMA SE USARA LA LETRA -D- PARA REPRESENTARLA "<<endl ;
  1080. getche();
  1081. }
  1082. }// FIN DE DAMAS
  1083. system("CLS");
  1084. cout<<"\t\t         ";
  1085. imprimir() ;
  1086. if (fichao==0)
  1087.     {
  1088.     cout<<"JUEGO TERMINADO JUGADOR UNO A GANADO ESTA PARTIDA  " <<endl;
  1089.     terminar=1;
  1090.     break;
  1091. }
  1092. else if (contador_fichas_x==0)
  1093.     {
  1094.     cout<<"JUEGO TERMINADO JUGADOR UNO A GANADO ESTA PARTIDA  " <<endl;
  1095.     terminar=1;
  1096.     break;
  1097. }
  1098. if(turno==0)
  1099. {
  1100. mover1();}
  1101. contador_fichas_o = contador_fichas_o - 1;
  1102. cout<<"JUGADOR DOS LE QUEDAN "<<contador_fichas_o<<" TURNOS "<<endl;
  1103. getche();
  1104.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1105. {
  1106. if(tablero[7][x]== 'O' )
  1107. {
  1108. tablero[7][x]='C';
  1109. cout<<"TU FICHA SE A CONVERTIDO EN DAMA SE USARA LA LETRA -C- PARA REPRESENTARLA "<<endl ;
  1110. getche();
  1111. }
  1112. }// FIN DE DAMAS
  1113. system("CLS");
  1114. cout<<"\t\t         ";
  1115. imprimir() ;
  1116.  if(fichax==0){
  1117.      cout<<"JUEGO TERMINADO JUGADOR DOS A GANADO ESTA PARTIDA "<<endl;
  1118.      terminar=1;
  1119.      break;
  1120.      }
  1121. else if (contador_fichas_o==0)
  1122.     {
  1123.     cout<<"JUEGO TERMINADO JUGADOR DOS A GANADO ESTA PARTIDA  " <<endl;
  1124.     terminar=1;
  1125.     break;
  1126. }
  1127. }while(terminar=2);
  1128.  }//OPCIONES DEL JUEGO *************************************************************************************************************
  1129. break;
  1130. case 3:
  1131. {
  1132.       cout<<"\t\t         ";
  1133.   system("color 0A") ;
  1134. rellenar();
  1135. imprimir() ;
  1136. do
  1137. {
  1138. for(i=0;i<T;i++)
  1139. {
  1140. for(j=0;j<T;j++)
  1141. {
  1142. if (tablero[i][j]=='D' && tablero[i+2][j+2]==' ' && (tablero[i+1][j+1]=='O'||tablero[i+1][j+1]=='C') && j!= 6)
  1143. {
  1144. cout<<"LA COMPUTADORA TE OBLIGO A COMER SU FICHA EN "<<i+1<<"-"<<j+1<<endl;
  1145. tablero[i][j]=' ';
  1146. tablero[i+1][j+1]= ' ';
  1147. tablero[i+2][j+2]='D' ;
  1148. getche();
  1149. fichao=fichao-1;
  1150. turno=0;}
  1151. else if (tablero[i][j]=='D' && tablero[i+2][j-2]==' ' && (tablero[i+1][j-1]=='O'||tablero[i+1][j-1]=='C') && j!= 1)
  1152. {
  1153. cout<<"LA COMPUTADORA TE OBLIGO A COMER SU FICHA EN "<<i+1<<"-"<<j-1<<endl;
  1154. tablero[i][j]=' ';
  1155. tablero[i+1][j-1]= ' ';
  1156. tablero[i+2][j-2]='D' ;
  1157. getche();
  1158. fichao=fichao-1;
  1159. turno=0;}      
  1160. else if (tablero[i][j]=='D' && tablero[i-2][j+2]==' ' && (tablero[i-1][j+1]=='O'||tablero[i-1][j+1]=='C')  && j!= 6)
  1161. {
  1162. cout<<"LA COMPUTADORA TE OBLIGO A COMER SU FICHA EN "<<i-1<<"-"<<j+1<<endl;
  1163. tablero[i][j]=' ';
  1164. tablero[i-1][j+1]= ' ';
  1165. tablero[i-2][j+2]='D' ;
  1166. getche();
  1167. fichao=fichao-1;
  1168. turno=0;}      
  1169. else if(tablero[i][j]=='D'&& tablero[i-2][j-2]==' ' && (tablero[i-1][j-1]=='O'||tablero[i-1][j-1]=='C') && j!= 1 )
  1170. {
  1171. cout<<"LA COMPUTADORA TE OBLIGO A COMER SU FICHA EN "<<i-1<<"-"<<j-1<<endl;
  1172. tablero[i][j]=' ';
  1173. tablero[i-1][j-1]= ' ';
  1174. tablero[i-2][j-2]='D' ;
  1175. getche();
  1176. fichao=fichao-1;
  1177. turno=0;}        
  1178. else if(tablero[i][j]=='X'&& tablero[i-2][j-2]==' ' && (tablero[i-1][j-1]=='O'||tablero[i-1][j-1]=='C') && j!= 1  )
  1179. {
  1180. cout<<"LA COMPUTADORA TE OBLIGO A COMER SU FICHA EN "<<i-1<<"-"<<j-1<<endl;
  1181. tablero[i][j]=' ';
  1182. tablero[i-1][j-1]= ' ';
  1183. tablero[i-2][j-2]='X' ;
  1184. getche();
  1185. fichao=fichao-1;
  1186. turno=0;}
  1187. else if (tablero[i][j]=='X' && tablero[i-2][j+2]==' ' && (tablero[i-1][j+1]=='O'||tablero[i-1][j+1]=='C') && j!= 6 )
  1188. {
  1189. cout<<"LA COMPUTADORA TE OBLIGO A COMER SU FICHA EN "<<i-1<<"-"<<j+1<<endl;
  1190. tablero[i][j]=' ';
  1191. tablero[i-1][j+1]= ' ';
  1192. tablero[i-2][j+2]='X' ;
  1193. getche();
  1194. fichao=fichao-1;
  1195. turno=0;}
  1196. }
  1197. }
  1198. if(turno==1)
  1199. {    
  1200. mover2();}
  1201.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1202. {
  1203. if(tablero[0][x]== 'X' )
  1204. {
  1205. tablero[0][x]='D';
  1206. cout<<"TU FICHA SE A CONVERTIDO EN DAMA SE USARA LA LETRA -D- PARA REPRESENTARLA "<<endl ;
  1207. getche();
  1208. }
  1209. }// FIN DE DAMAS
  1210. system("CLS");
  1211. cout<<"\t\t         ";
  1212. imprimir() ;
  1213. if (fichao==0)
  1214.     {
  1215.     cout<<"JUEGO TERMINADO JUGADOR UNO A GANADO ESTA PARTIDA  " <<endl;
  1216.     terminar=2;
  1217.     break;
  1218. }
  1219. for(i=0;i<T;i++)
  1220. {
  1221. for(j=0;j<T;j++)
  1222. {
  1223. if(tablero[i][j]=='C'&& tablero[i+2][j+2]==' ' && (tablero[i+1 ][j+1]=='X'||tablero[i+1 ][j+1]=='D') && j!=1)
  1224. {
  1225. cout<<"LA COMPUTADORA COMIO TU FICHA EN"<<i+1<<"-"<<j+1<<endl;
  1226. tablero[i][j]=' ';
  1227. tablero[i+1][j+1]= ' ';
  1228. tablero[i+2][j+2]='C' ;
  1229. getche();
  1230. fichax=fichax-1;
  1231. turno=1;}
  1232. if (tablero[i][j]=='C' && tablero[i-2 ][j-2]==' ' && ( tablero[i-1][j-1]=='X'||tablero[i-1][j-1]=='D') && j!=1)
  1233. {
  1234. cout<<"LA COMPUTADORA COMIO TU FICHA EN "<<i-1<<"-"<<j-1<<endl;
  1235. tablero[i][j]=' ';
  1236. tablero[i-1][j-1]= ' ';
  1237. tablero[i-2][j-2]='C' ;
  1238. getche();
  1239. fichax=fichax-1;
  1240. turno=1;}
  1241. else if (tablero[i][j]=='C' && tablero[i-2][j+2]==' ' && (tablero[i-1][j+1]=='X'||tablero[i-1][j+1]=='D') && j!=6  )
  1242. {
  1243. cout<<"LA COMPUTADORA COMIO TU FICHA EN "<<i-1<<"-"<<j+1<<endl;
  1244. tablero[i][j]=' ';
  1245. tablero[i-1][j+1]= ' ';
  1246. tablero[i-2][j+2]='C' ;
  1247. getche();
  1248. fichax=fichax-1;
  1249. turno=1;}
  1250. else if (tablero[i][j]=='C' && tablero[i+2][j-2]==' ' && (tablero[i+1][j-1]=='X'||tablero[i+1][j-1]=='D') && j!=6)
  1251. {
  1252. cout<<"LA COMPUTADORA COMIO TU FICHA EN "<<i+1<<"-"<<j-1<<endl;
  1253. tablero[i][j]=' ';
  1254. tablero[i+1][j-1]= ' ';
  1255. tablero[i+2][j-2]='C' ;
  1256. getche();
  1257. fichax=fichax-1;
  1258. turno=1;}
  1259. else if(tablero[i][j]=='O'&& tablero[i+2][j+2]==' ' &&( tablero[i+1][j+1]=='X'||tablero[i+1][j+1]=='D') && j!=6)
  1260. {
  1261. cout<<"LA COMPUTADORA COMIO TU FICHA EN "<<i+1<<"-"<<j+1<<endl;
  1262. tablero[i][j]=' ';
  1263. tablero[i+1][j+1]= ' ';
  1264. tablero[i+2][j+2]='O' ;
  1265. getche();
  1266. fichax=fichax-1;
  1267. turno=1;}
  1268. else if (tablero[i][j]=='O' && tablero[i+2 ][j-2 ]==' ' && (tablero[i+1][j-1]=='X' ||tablero[i+1][j-1]=='D' ) && j!=1)
  1269. {            
  1270. cout<<"LA COMPUTADORA COMIO TU FICHA EN "<<i+1<<"-"<<j-1<<endl;
  1271. tablero[i][j]=' ';
  1272. tablero[i+1][j-1]= ' ';
  1273. tablero[i+2][j-2]='O' ;
  1274. getche();
  1275. fichax=fichax-1;
  1276. turno=1;}
  1277. }
  1278. }
  1279. if(turno==0)
  1280. {
  1281. cpu();}
  1282.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1283. {
  1284. if(tablero[7][x]== 'O' )
  1285. {
  1286. tablero[7][x]='C';
  1287. cout<<"LA COMPUTADORA SE A CORONADO -C- PARA REPRESENTARLA "<<endl ;
  1288. getche();
  1289. }
  1290. }// FIN DE DAMAS
  1291. system("CLS");
  1292. cout<<"\t\t         ";
  1293.  for (x=0;x<T;x++)// PARA IDENTIFICAR UNA DAMA
  1294. {
  1295. if(tablero[7][x]== 'O' )
  1296. {
  1297. tablero[7][x]='C';
  1298. }
  1299. }// FIN DE DAMAS
  1300. imprimir() ;
  1301.  if(fichax==0){
  1302.      cout<<"JUEGO TERMINADO COMPUTADORA A  GANADO ESTA PARTIDA "<<endl;
  1303.      terminar=2;
  1304.      break;
  1305.      }
  1306. }while(terminar==1);
  1307.  break ;    
  1308.  }//FIN CASE MODO CONTRA LA COMPUTADORA
  1309. case 4:
  1310. {
  1311. cout<<"\t********************MODO DE JUEGO NORMAL********************** "<<endl;
  1312. cout<<"\n";
  1313. cout<<"INSTRUCCIONES PARA JUGAR A DAMAS EN C++ LA PARTIDA COMENZARA CON LAS FICHAS 'X'"<<endl;
  1314. cout<<"PARA HACER UN MOVIMIENTO DEBE SELECCIONAR PRIMERO LA COORDENADA VERTICAL, Y "<<endl;
  1315. cout<<"DESPUES LA COORDENADA HORIZONTAL, CASO DE NO HABER FICHA SE TE VOLVERA A PEDIR"<<endl;
  1316. cout<<"QUE VUELVAS A TIRAR PARA SELECCIONAR EL MOVIMIENTO DE LA FICHA PERSIONA [1]"<<endl;
  1317. cout<<"PARA MOVERLA DIAGONALMENTE IZQUIERDA O [2] PARA DIAGONAL DERECHA"<<endl;
  1318. cout<<"EL JUEGO TERMINA CUANDO YA NO HAIGA FICHAS CONTRARIAS QUE COMER."<<endl;
  1319. cout<<"\n";
  1320. cout<<"\t********************MODO DE JUEGO ESPECIAL******************** "<<endl;
  1321. cout<<"\n";
  1322. cout<<"TE HAS ABURRIDO DEL MODO NORMAL PRUEBA EL MODO ESPECIAL DONDE LOS JUGADORES "<<endl;
  1323. cout<<"EMPIEZAN CON 7 TURNOS DE JUEGO, ADEMAS NO HAY REGLAS AQUI, CUANDO LOS JUGADORES"<<endl;
  1324. cout<<"TERMINAR UN MOVIMIENTO ESTOS SE REDUCEN EN UNO SI LOS TURNOS DE UN JUGADOR"<<endl;
  1325. cout<<"LLEGAN A 0 LA PARTIDA FINALIZA AUTOMATICAMENTE O SI YA NO HAY FICHAS QUE COMER "<<endl;
  1326. cout<<"DANDO POR GANADOR AL JUGADOR QUE AUN TENGA CONTADORES , PERO NO TE PREOCUPES"<<endl;
  1327. cout<<"PORQUE SI LLEGAS A COMER UNA FICHA CONTRARIA AUMENTARAS TUS CONTADORES EN DOS  "<<endl;
  1328. cout<<"POR CADA FICHA CONTRARIA COMIDA ,ASI QUE PREPARA TUS MEJORES JUGADAS Y "<<endl;
  1329. cout<<"ESTRATEGIAS Y NO DEJES QUE EL JUGADOR CONTRARIO GANE ESTA PARTIDA. "<<endl;
  1330. cout<<"\n"<<endl;
  1331. cout<<"CONSEJOS: SI ESTAS CANSADO DE QUE LOS CONTADORES PARA EL MODO ESPECIAL"<<endl;
  1332. cout<<"SIEMPRE SEAN LOS MISMOS NO TE PREOCUPES EN EL MENU EN LA PARTE DE OPCIONES  "<<endl;
  1333. cout<<"PUEDES MODIFICAR LOS CONTADORES DE INICIO PARA CADA JUGADOR."<<endl;
  1334. cout<<"\n";
  1335. cout<<"\t********************MODO VS COMPUTADORA ******************** "<<endl;
  1336. cout<<"\n";
  1337. cout<<"SI NO TIENES CON QUIEN JUGAR EN ESTE MODO PODRAS SIMULAR UN JUEGO "<<endl;
  1338. cout<<"CONTRA LA COMPUTADORA PARA PRACTICAR TUS JUGADAS "<<endl ;
  1339. getche();
  1340. system("CLS");
  1341. }
  1342. break;
  1343. case 5 :
  1344. {
  1345. do
  1346. {
  1347. cout<<"SELECCIONA LA CANTIDAD DE TURNOSPARA AMBOS JUGADORES "<<endl;
  1348. cout<<"TURNOS PARA JUGADOR 1 "<<endl;
  1349. cin>>contador_fichas_x;
  1350. if(contador_fichas_x<1)
  1351. {
  1352. cout<<"ERROR INTRODUCE UN NUMERO VALIDO MAYOR A 0 "<<endl;
  1353. getche();
  1354. system("CLS");
  1355. }
  1356. }while(contador_fichas_x<1);
  1357. do
  1358. {
  1359. cout<<"TURNOS PARA JUGADOR 2 "<<endl;
  1360. cin>>contador_fichas_o;
  1361. if(contador_fichas_o<1)
  1362. {
  1363. cout<<"ERROR INTRODUCE UN NUMERO VALIDO MAYOR A 0 "<<endl;
  1364. getche();
  1365. system("CLS");
  1366. }
  1367. }while(contador_fichas_o<1);
  1368. system("CLS");
  1369.  }
  1370. break ;
  1371. }//FIN DE SWITCH
  1372. }while (seleccion<=5&&seleccion>=1);
  1373. system("pause");}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement