Example #1
0
        protected override void SolvePartTwo()
        {
            uint target            = ~(uint)0 >> 6;
            var  startLocations    = new string[] { "0", "1", "2", "3" };
            var  initialSearchNode = new QuadrantSearchNode(0, startLocations, target, this, 0);
            var  result            = Search <HeapPriorityQueue <SearchNode> > .Execute(initialSearchNode);

            resultPartTwo = result.cost.ToString();
        }
Example #2
0
 public QuadrantSearchNode(uint keyring, string[] locations, uint target, Solver environment, int cost, QuadrantSearchNode parent = null) : base(cost, parent)
 {
     this.keyring     = keyring;
     this.locations   = locations;
     this.target      = target;
     this.environment = environment;
     missingKeys      = target ^ keyring;
 }