Update prog1.cc

This currently goes into infinite loop. Need to implement proper A* search.