Eventually, the troll reaches the sea and realises that he has been tricked by the other animals; he sees what he thinks are goat tracks in the sand and sets about laying a trap for the goat in a spot not too far from the location on the pirate's treasure map.