一个关于用C语言写井字棋的游戏的问题 怎么让他重新开始的问题 代码如 ...
发布网友
发布时间:2022-05-09 21:13
我来回答
共1个回答
热心网友
时间:2022-04-19 02:01
不知道你在问什么??
重新开始就写循环啊,用循环把那些东西包起来
检测胜利用函数就写个函数呗
int v(int i){
if ((board[0][0] == board[1][1] && board[1][1] == board[2][2]) || (board[0][2] == board[1][1] && board[1][1] && board[1][1] == board[2][0]))
{
printf("Congratulations, player %d is the winner\n",i);
return 0;
}
if (board[ROW][0] == board[ROW][1] && board[ROW][1] == board[ROW][2])
{
printf("Congratulations, player %d is the winner\n",i);
return 0;
}
if (board[0][COL] == board[1][COL] && board[1][COL] == board[2][COL])
{
printf("Congratulations, player %d is the winner\n",i);
return 0;
}
return 1;
}
追问我想问一下 怎么讲这里检测函数里面的row col传递到主函数里面