private int x1;
//落子位置
private int y1;
private int[,] Map = new int[10, 10];
//0无子 1黑色 2白色
private int MyColor;
string[] Info = new string[61];
public Form1()
{
InitializeComponent();
}
private void Show_Can_Position()
{
//用图片形式显示可以落子的位置
int i;
int j;
Graphics g = this.pictureBox1.CreateGraphics();
Bitmap bitmap = new Bitmap("Info2.png");
//提示图片
int n = 0;
for (i = 1; i <= 8; i )
{
for (j = 1; j <= 8; j )
{
if (Map[i, j] == 0 & Can_go(i, j))
{
Info[n] = i "|" j;
n = n 1;
g.DrawImage(bitmap, (i - 1) * 45 26, (j - 1) * 45 26, 30, 30);
}
}
}
}
//统计可以落子的位置数
private int Show_Can_Num()
{
int i, j;
int n = 0;
for (i = 1; i <= 8; i )
{
for (j = 1; j <= 8; j )
{
if (Can_go(i, j))
{
Info[n] = i "|" j;
n = n 1;
}
}
}
return n;
//可以落子的位置个数
}
评论