using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Web;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace WuZi
{
public partial class Form1 : Form
{
int[,] QiZi = new int[20, 20];//0 无子 1 黑子 2 白子
static int shu = 1;//计算下棋次数
Boolean game = false;//游戏开始结束标志
private Boolean black = false;
private Boolean white = false;
static int x, y;
//记录棋子位置,用于悔棋和回放
private List<Int32> xblack = new List<int>();
private List<Int32> yblack = new List<int>();
private List<Int32> xwhite = new List<int>();
private List<Int32> ywhite = new List<int>();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private static bool IsPixelFormatIndexed(PixelFormat imgPixelFormat)
{
return false;
}
private void panel1_Paint(object sender, PaintEventArgs e)//画棋盘
{
Image k = Image.FromFile(@"E:\棋盘.jpg");
pictureBox1.Location = new Point(30, 30);
pictureBox1.Image = k;
}
private void newToolStripMenuItem_Click(object sender, EventArgs e)//开始按钮的功能
{
if (game == true)
{
MessageBox.Show("The game has began!!");
}
else
{
game = true;
}
}
private void pictureBox1_MouseClick(object sender, MouseEventArgs e)//下棋
{
PictureBox pb = new PictureBox();//新建pictureBox,保存棋子图片
x = e.X / 45 * 45 + 35;