Part 3 - Following
Every turn when the dog is tame and the dog is somewhere (this is the dog moving rule):
let the target be the location;
let kennel be the location of the dog; [1]
if the kennel is the target:
make no decision;
if (the kennel is the Upstairs corridor and the target is the Hotel lobby) or (the kennel is the Hotel lobby and the target is the Upstairs corridor): [2]
make no decision;
let the way be the best route from the kennel to the location, using doors;
if the way is not nothing and (the door way from the kennel is nothing or the door way from the kennel is open):
try the dog going the way.
Last report going when the tame dog is in the location:
say "The dog wags his tail, glad to see [us]."