public virtual void Solve(CountdownPuzzle puzzle) { this.puzzle = puzzle; this.container.Initialise(puzzle); solutions.Clear(); SolveImplementation(); }
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 }); } }
/// <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);