Hey people!
I'm trying to make a chess board for this chess game that I made. Obviously there's a (circumstantial) board in the game at the moment, but I'm not altogether happy with it. it's just:
being printed off.Code:char ChessBoard[8][8] = { { 'R', 'N', 'B', 'Q', 'K', 'B', 'N', 'R' }, { 'P', 'P', 'P', 'P', 'P', 'P', 'P', 'P' }, { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' }, { 'p', 'p', 'p', 'p', 'p', 'p', 'p', 'p' }, { 'r', 'n', 'b', 'q', 'k', 'b', 'n', 'r' } };
I'd like to be able to have a black and white checkerred box.
I tried using this:
HANDLE hConsole;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
to change the color .... but it's rather longwinded and I'm sure that there is a better way to do it!! Is there a way to set the color of an element(s) of an array?? cheers!