#include #include "board.h" #include "input.h" int cursorPosX = 4; int cursorPosY = 3; /* Create the board as a 2d array */ char board[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'}, }; void PrintBoard(char board[8][8]){ for (int i=0; i<8;i++){ for (int j=0; j<8;j++){ if ( i == cursorPosX && j == cursorPosY ) { attron(COLOR_PAIR(3)); printw(" %c ", board[i][j]); attroff(COLOR_PAIR(3)); } else if ((i + j) & 1) /* Make all the even positions white */ { attron(COLOR_PAIR(1)); printw(" %c ", board[i][j]); attroff(COLOR_PAIR(1)); } else { attron(COLOR_PAIR(2)); printw(" %c ", board[i][j]); attroff(COLOR_PAIR(2)); } } attron(A_BOLD | COLOR_PAIR(4)); if ( i == 1) printw(" HAND: %d ", hand); if ( i == 6) printw(" POSITION: %d ", board[cursorPosX][cursorPosY]); attroff(A_BOLD | COLOR_PAIR(4)); printw("\n"); } }