五子棋

发布时间 2023-08-10 20:21:46作者: fushuxuan1
#include <bits/stdc++.h>
using namespace std;
int ROW=16;//行 
int COL=16;//列 
bool IS_BLACK=true;//是否黑棋下 
int ALL_LIST[16][16];
bool BLASK_LIST[16][16];
bool BLACK_WIN;
bool WHILE_WIN; 
void f5(){	
	for(int col=0;col<=COL;col++){
			cout<<setw(3)<<col;
	}
	cout<<endl;
	for(int row=0;row<ROW;row++){
		cout<<setw(3)<<row+1;
		for(int col=0;col<COL;col++){
			if(ALL_LIST[row][col]==0){
				cout<<setw(3)<<".";
			}else if(ALL_LIST[row][col]==1){
				cout<<setw(3)<<"黑";
			}else if(ALL_LIST[row][col]==2){
				cout<<setw(3)<<"白";
			}
			
		}
		cout<<endl;
	}
	
}
bool  BLACK_ISWIN(){
	for(int i=0;i<ROW;i++){
		
	} 
	
	return false;
}
bool while_ISWIN(){
	
	return false;
}
int main(int argc, char** argv) {
	int x,y;
	while(1){
		system("cls");
		f5();
		if(IS_BLACK){
			cout<<"黑棋请落子";
			cin>>x>>y;
			if(ALL_LIST[x-1][y-1]!=0){
				continue; 
			}
			ALL_LIST[x-1][y-1]=1;
			BLACK_LIST[x-1][y-1]=true; 
			IS_BLACK=false;
		}else{
			cout<<"白棋请落子";
			cin>>x>>y;
			if(ALL_LIST[x-1][y-1]!=0){
				continue; 
			}
			ALL_LIST[x-1][y-1]=2; 
			IS_BLACK=true;
		}
	}
	return 0;
}