Пример #1
0
        private static void AnimateSolutions(IStateSearchable <EightPuzzle> search)
        {
            IEnumerable <EightPuzzle> solution = search.Path.Reverse();

            foreach (var item in solution)
            {
                PrintPuzzleString(item.ToString());
                Thread.Sleep(200);
            }
        }
Пример #2
0
        // 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;
        }