示例#1
0
 private void DrawSolution(Solution solution)
 {
     int startCol = input.GetLength(1) - solution.board.Count;
     for (int r = 0; r < input.GetLength(0); r++)
     {
         for (int c = startCol; c < input.GetLength(1); c++)
         {
             var choice = solution.board[solution.board.Count - 1 - (c - startCol)];
             board.DrawCell(r, c, choice[r, 0], choice[r, 1]);
         }
     }
 }
示例#2
0
 private void ProcessSolution(Solution solution, TimeSpan? elapsed)
 {
     Dispatcher.BeginInvoke((Action)(() =>
     {
         DrawSolution(solution);
     }));
     DisplayResult(string.Format("max={0}{1}", solution.score,
         elapsed != null ? string.Format(" spent {0} s", elapsed.Value.TotalSeconds) : ""));
 }