Exemple #1
0
 public bool startsolve()
 {
     current = FirstNode = FindFirstNode();
     HintStack.Push(FirstNode);
     maxval  = FindMaxVal();
     history = new history();
     history.AddNode(current);
     NextNode = FindNextNode(current);
     HintStack.Push(NextNode);
     if (solve())
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemple #2
0
        public void Startsolve(Hidato_Board board)
        {
            SolveCancel = false;
            m_isProcess = true;
            DateTime dtstart = DateTime.Now;

            current  = FirstNode = FindFirstNode();
            maxval   = FindMaxVal();
            history  = new history();
            NextNode = FindNextNode(current);
            InitList();
            SmartSuch      = false;
            EmptyNodeCount = maxval - HintCount();

            if (SmartSuch == true)
            {
                current = FindMinPossibe();
            }

            RefBoard     = board;
            DTNextUpdate = DTNextUpdate.AddSeconds(NextUpdateSoconds);

            bool success = Solve();

            m_isProcess = false;
            if (success && !SolveCancel)
            {
                RefBoard.ShowSFdialog(true, dtstart);
                return;
            }
            else if (success && SolveCancel)
            {
                return;
            }
            else
            {
                RefBoard.ShowSFdialog(false, dtstart);
                return;
            }
        }