チェスゲームで王を動かすためのコードを書きました。キングが動かないこのコードの問題はどこにあるのか教えていただけますか?ありがとう。
編集2:
public partial class Form1 : Form
{
PictureBox[,] pic = new PictureBox[8, 8];
private void pictureBox34_Click(object sender, EventArgs e)
{
if (pictureBox34.Image == chess9.Properties.Resources.siyahsah2)
{
f();
}
}
public void picarray()
{
pic[0, 0] = pictureBox54;
pic[0, 1] = pictureBox64;
pic[0, 2] = pictureBox48;
pic[0, 3] = pictureBox42;
pic[0, 4] = pictureBox34;
pic[0, 5] = pictureBox26;
pic[0, 6] = pictureBox18;
pic[0, 7] = pictureBox8;
pic[1, 0] = pictureBox1;
pic[1, 1] = pictureBox2;
pic[1, 2] = pictureBox3;
pic[1, 3] = pictureBox4;
.
.///thats so long(64 arrays)
.
}
public void f()
{
int x = 3;
int y = 3;
for (int i = 1; i < x; i++)
{
for (int j = 1; j < y; j++)
{
pic[i, j] = new PictureBox();
pic[i, j] = pic[i + 1, j + 1];
pic[i, j] = new PictureBox();
pic[i, j].Image = Image.FromFile("pic/siyahsah2.jpg");
}
}
}