private static void AnimateSolutions(IStateSearchable <EightPuzzle> search) { IEnumerable <EightPuzzle> solution = search.Path.Reverse(); foreach (var item in solution) { PrintPuzzleString(item.ToString()); Thread.Sleep(200); } }
// Done! private void PlayAnimation(IStateSearchable <EightPuzzle> puzzle) { IEnumerable <EightPuzzle> solution = puzzle.Path.Reverse(); AlterBoardConfigurationDelegate call = this.AlterBoardConfiguration; // Vamos percorer cada estado! foreach (var item in solution) { this.Dispatcher.BeginInvoke(DispatcherPriority.Send, call, this.ContentHolder, item.ToString()); Thread.Sleep(300); } locked = false; }