//头文件
#ifndef __GAME_H__
#define __GAME_H__
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define ROW 5
#define COL 5
void board_display(char arr[ROW][COL], int row, int col);
void init_board(char arr[ROW][COL], int row, int col);
void PalyerMove(char arr[ROW][COL], int row, int col);
void ComputerMove(char arr[ROW][COL], int row, int col);
int check_win(char arr[ROW][COL], int row, int col);
int show(char arr[ROW][COL], int row, int col);
#endif//__GAME_H__
//主函数
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include"game.h"
void menu()
{
printf("*************************\n");
printf("*** 1.play 2.exit ***\n");
printf("*************************\n");
}
void game()
{
int row = 0;
int col = 0;
char arr[ROW][COL] = { 0 };
char ret = 0;
init_board(arr, row, col);
do
{
board_display(arr, row, col);
printf("玩家走:\n");
PalyerMove(arr, row, col);
board_display(arr, row, col);
ret = check_win(arr, row, col);
if (ret != ' ')
#ifndef __GAME_H__
#define __GAME_H__
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define ROW 5
#define COL 5
void board_display(char arr[ROW][COL], int row, int col);
void init_board(char arr[ROW][COL], int row, int col);
void PalyerMove(char arr[ROW][COL], int row, int col);
void ComputerMove(char arr[ROW][COL], int row, int col);
int check_win(char arr[ROW][COL], int row, int col);
int show(char arr[ROW][COL], int row, int col);
#endif//__GAME_H__
//主函数
#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include"game.h"
void menu()
{
printf("*************************\n");
printf("*** 1.play 2.exit ***\n");
printf("*************************\n");
}
void game()
{
int row = 0;
int col = 0;
char arr[ROW][COL] = { 0 };
char ret = 0;
init_board(arr, row, col);
do
{
board_display(arr, row, col);
printf("玩家走:\n");
PalyerMove(arr, row, col);
board_display(arr, row, col);
ret = check_win(arr, row, col);
if (ret != ' ')