Ver Mensaje Individual
  #18 (permalink)  
Antiguo 28/11/2015, 20:35
chobbyg
 
Fecha de Ingreso: agosto-2009
Mensajes: 2
Antigüedad: 14 años, 8 meses
Puntos: 0
Información Respuesta: Tablero ajedrez dev c++

Saludos

Aqui te dejo un ejemplo que cree

#include <iostream>
#include <windows.h>
int color (int n);
using namespace std;
int main(void)
{
cout <<" TABLERO DE AJEDREZ" <<endl;
cout <<"========================" <<endl;
cout<<" "<<"A"<<"";
cout<<" "<<"B"<<"";
cout<<" "<<"C"<<"";
cout<<" "<<"D"<<"";
cout<<" "<<"E"<<"";
cout<<" "<<"F"<<"";
cout<<" "<<"G"<<"";
cout<<" "<<"H"<<endl;
int i,j;
for (i = 0; i < 8; i++){
color(7);
cout<<i+1;
for (j = 0; j < 8; j++){

if ((i+1+j+1)%2==0)
color (51);
else
color (17);
cout <<"[ "<< "]";
}
cout <<endl;
}
color(7);
cout <<endl<<"Disenado por: Jose Agustin Guzman"<<endl;
color (3);
system("PAUSE");
return 0;
}
int color (int n)
{
SetConsoleTextAttribute(GetStdHandle (STD_OUTPUT_HANDLE), n );
}