예제 #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            count            = 1;
            label13.Text     = "Trường hợp thứ: " + count;
            btnNext.Enabled  = true;
            btnReset.Enabled = true;
            ketqua           = Giai8QuanHau.giaiBaiToan();
            int[,] ketqua1   = new int[8, 8];
            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    ketqua1[i, j] = ketqua[sttBanCo, i, j];
                }
            }
            sttBanCo++;
            Graphics g = panelBanCo.CreateGraphics();

            for (int i = 0; i < 8; i++)
            {
                for (int j = 0; j < 8; j++)
                {
                    if (ketqua1[i, j] == 1)
                    {
                        g.DrawImage(Properties.Resources.hau, i * cellWidth, j * cellWidth, cellWidth, cellWidth);
                    }
                }
            }
        }
예제 #2
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     sttBanCo = 0;
     Giai8QuanHau.reset();
     this.Refresh();
     count        = 0;
     label13.Text = "Trường hợp thứ: " + count;
 }