输入坐标版
#include <stdio.h>
#include <stdlib.h>
char brd[15][15]; //定义15*15棋盘
char p='@'; //黑:@ 白:$
int x,y; //棋子坐标
int coor[8]={0,1,1,0,-1,-1,-1,1}; //四个方向
void ori(void); //初始化棋盘
void show(void); //显示棋盘
void play(void); //落子
int judge(void); //判断
int uzi(int m,int n); //五子,yyds
int main(int argc,const char* argv[])
{
ori();
for(int i=0;i<225;i++)
{
system("clear");
show();
play();
if(judge())
{
system("clear");
show();
printf("%c胜利,游戏结束\n",p);
return 0;
}
p=p=='@'?'$':'@'; //更换棋子
}
printf("平局\n");
}
void ori(void)
{
for(int i=0;i<15;i++)
{
for(int j=0;j<15;j++)
{