示例#1
0
void draw_board()
{
	int j;
	SetConsoleTextAttribute(h, 4); // 4 - LIGHT RED

 	for (j = 9; j<17; j++)
	{
		gotoxy(35, j);
		printf("|       |");

	}
	gotoxy(28, 11);
	printf("-----------------------");
	gotoxy(28, 14);
	printf("-----------------------");
	char string[2];
	for (j = 1; j < 10; j++){
		_itoa(j, string, 10);
		put_X_O(string[0], convert_pos_to_row(j),convert_pos_to_col(j));
	}
	SetConsoleTextAttribute(h, 7);

	for (int i = 0; i < GAME_SIZE; i++)
		for (j = 0; j < GAME_SIZE; j++)
		if (board[i][j] == X_VALUE)
			put_X_O('X',i,j);
		else if (board[i][j] == O_VALUE)
			put_X_O('O', i,j);
}
示例#2
0
void draw_board(){
 	int j;

 	for(j=9;j<17;j++){
  		gotoxy(35,j);
  		printf("|       |");
 }
 	gotoxy(28,11);
 	printf("-----------------------");
 	gotoxy(28,14);
 	printf("-----------------------");

 	for(j=1;j<10;j++){
  		if(panel[j] == 3)
   		put_X_O('X',j);
  	else
  		if(panel[j] == 5)
   			put_X_O('O',j);
 }
}