Use systematic manual testing to help write software.
(Unique Video Reference: 15_RR_CU2)
We would love to know…
What you found good about this lecture?
What we could do better?
Remember that you can reply to this topic, or create a new topic. The easiest way to create a new topic is to follow the link in Resources. That way the topic will…
I would argue that the IsExplored flag should not be on the Waypoint. IsExplored is really only for the PathFinder. I think a much better way would be to add a dictionary of explored waypoints to PathFinder and add Waypoints to it as you go, and then do a ContainsKey against it to decide if the Waypoint has been explored already. This keeps the pathfinding in the PathFinder class and out of the Waypoint class.
Waypoint w = EndBlock;
while (w != StartBlock)
{
print(w);
w = _path[w];
}
This kept path finding completely in the PathFinder. No mods to Waypoint needed.
Maybe this would be more confusing, but it avoid using anything you haven’t already covered and it does a better job of separating concerns.
Small comment on the original code in the lecture - maybe it gets fixed later, not sure yet.
I don’t like the try/catch around the entirety of QueueNewNeighbours as it was only intended to catch a failure of grid[]. This can cause problems for students who make a logical error in QueueNewNeighbours and end up ignoring an exception they weren’t expecting.
One way to fix this is to specifically catch the KeyNotFound exception.