三子棋/井字棋(C语言)-game.h如下:

时间:2024-01-20 21:15:17

#pragma once
#define ROW 3
#define COL 3
#include <stdlib.h>
#include <time.h>
#include <stdio.h>

//初始化棋盘的函数
void InitBoard(char board[ROW][COL], int row, int col);
//打印棋盘的函数
void DisplayBoard(char board[ROW][COL], int row, int col);
//玩家下棋
void PlayerMove(char board[ROW][COL], int row, int col);
//电脑下棋
void ComputerMove(char board[ROW][COL], int row, int col);
//玩家赢返回"w"
//电脑赢返回"c"
//平局返回"q"
//继续返回"a"

char Iswin(char board[ROW][COL], int row, int col);
//判断棋盘是否已经满了
int IsFull(char board[ROW][COL], int row, int col);