Exemple #1
0
        private void btnGiai_Click(object sender, EventArgs e)
        {
            Stopwatch st = new Stopwatch();

            st.Start();

            var arr   = chessBoardSdk.LayArr();
            var sdk   = new GiaiSudoku(arr);
            var arrkq = sdk.LayKetQua();

            chessBoardSdk.GanArr(arrkq);
            chessBoardSdk.arrDung = arrkq;
            st.Stop();
            MessageBox.Show(st.ElapsedMilliseconds.ToString());
        }
Exemple #2
0
        private void btnKt_Click(object sender, EventArgs e)
        {
            if (chessBoardSdk.arrDung == null)
            {
                chessBoardSdk.arrDung = new GiaiSudoku(new int[9, 9]).LayKetQua();
                if (cbbCauHoi.SelectedItem != null)
                {
                    string tenFile = cbbCauHoi.SelectedItem.ToString();

                    var arr = fileTex.LayDuLieuText(tenFile);

                    var sdk     = new GiaiSudoku(arr);
                    var arrDung = sdk.LayKetQua();
                    chessBoardSdk.arrDung = arrDung;
                }
                chessBoardSdk.KiemTraArrDung();
            }
            else
            {
                chessBoardSdk.KiemTraArrDung();
            }
        }