没事做,随手撸的代码
头文件
#include<bits/stdc++.h>
#include<windows.h>
#include<conio.h>
然后就是变量,二维数组Map是围棋地图
using namespace std;
int Map[19][19];
int end=0;
int x,y;
int turn=0;
char choose;
接着就直接是主函数
int main()
{
for(int i=0;i<19;i++)//行
{
for(int j=0;j<19;j++)//列
{
Map[i][j]=0;
}
}
while(end==0)
{
cout << " ITX围棋 " << endl << endl;
for(int i=0;i<19;i++)//行
{
for(int j=0;j<19;j++)//列
{
if(Map[i][j]==1)cout << " @";
else if(Map[i][j]==2)cout << " *";
else if(Map[i][j]==0)cout << " #";
}
cout <<