#include #include #include "board.h" #include "input.h" int main(void) { int ch; initscr(); /* Start curses mode */ if(has_colors() == FALSE) { endwin(); printf("Your terminal does not support colour\n"); exit(1); } start_color(); /* Start color */ noecho(); curs_set(0); keypad(stdscr, TRUE); /* End of ncurses init nonsense */ /* Don't use black it will mess with the background colour */ init_color(COLOR_RED, 556, 388, 176); init_color(COLOR_WHITE, 820, 840, 880); init_pair(1, COLOR_RED, COLOR_WHITE); init_pair(2, COLOR_WHITE, COLOR_RED); init_pair(3, COLOR_YELLOW, COLOR_BLUE); init_pair(4, COLOR_CYAN, COLOR_BLACK); while (turns < 1000){ refresh(); /* Print it on to the real screen */ char *player; player = (turns & 1) ? "BLACK" : "WHITE"; printw("Here is the board:\n"); PrintBoard(board); /* Print out the chess board */ printw("Turn No. %d (%s)", turns, player); ch = getch(); /* Wait for user input */ InputBoard(board, ch); clear(); } endwin(); /* End curses mode */ return 0; }