五子棋棋盘怎么用C++实现呢

来源:百度知道 编辑:UC知道 时间:2024/05/16 22:05:55

代码是:
#include<iostream>
#include<conio.h>
using namespace std;
void main()
{
int h,i,j,k;
cout<<" ";
for(h=0;h<=11;h++)
cout<<hex<<" "<<h<<" ";
cout<<endl;

for(j=0;j<=11;j++)
{
cout<<hex<<" "<<j<<" ";

for(k=1;k<=12;k++)
cout<<" * ";
cout<<endl;

}
getch();

}

正常情况下,任何棋盘都是可以使用背景图片来做,而不是靠自己去画。把QQ五子棋的背景弄下来,直接用就可以。你需要处理的是棋盘上的坐标位置。

#include <windows.h>
#include <stdio.h>
#define MAX 20
#define TextWidth 200
#define Time1 1
#define Time2 2
#define times 1
#define NO1 1
#define NO2 2
#define ERROR 0
#define NO 0
#define OK 1
int leng=1;
#define DEFAULT 0;

HDC hdc,hdc1,hdc2;

int x