Rapunzel and the prince woke up next to each other and found themselves in surrounded by complete darkness.
“Where are we?” asked the prince.
“It seems that my evil stepmother has left us in the middle of the Room of Despair,” replied Rapunzel.
“I don’t like this name. What do you know about the room?” inquired the prince.
“I know that it is square-shaped, and one of its walls has a little door in the middle. In order to escape, we should leave through that door, but we must be careful. There are werewolves tied to each corner of the room, and if any of us gets in their reach, will be ripped apart.” explained Rapunzel.
“I don't hear any werewolves around. And if I meet one, I can always slay it with my sword.” said the prince.
“Werewolves are mysterious creatures - very silent, very quick, and very strong. I know they are here, they are waiting, and we can't defeat them.” replied Rapunzel.
“OK then, since we don’t have anything else to do, let’s just pick a random direction and hope for the best.” suggested the Prince.
“That’s too much of a risk,” opposed Rapunzel, "It is said that one out of three people who dashes blindly in one direction, gets ripped by a werewolf even before reaching the walls. And I have a better idea anyway.”
What is the idea of Rapunzel?
Remark: The chains the werewolves are tied with have the same length.
Since just one out of three people gets caught by the werewolves if he starts walking blindly in one direction, it is easy to compute that the walls are approximately 10% closer to Rapunzel and the prince than the monsters. Now the prince can just grab Rapunzel's hair and starts making concentric circles with increasing radiuses around her, with Rapunzel spinning in one place, until he bumps into one of the walls, and then finds the door.