示例#1
0
 public virtual void Solve(CountdownPuzzle puzzle)
 {
     this.puzzle = puzzle;
     this.container.Initialise(puzzle);
     solutions.Clear();
     SolveImplementation();
 }
示例#2
0
        public override void Initialise(CountdownPuzzle puzzle)
        {
            map.Clear();
            var numbers = puzzle.GetCountdownNumbers();

            foreach (var number in numbers)
            {
                //add each number as a list.
                map.Add(number.GetHashCode(), new List <CountdownNumber> {
                    number
                });
            }
        }
示例#3
0
 /// <summary>
 /// Initialises the container to the 'first' iteration by populating the container with the intitial numbers
 /// in the puzzle
 /// </summary>
 /// <param name="puzzle"></param>
 public abstract void Initialise(CountdownPuzzle puzzle);