10

A thief has snuck his way into the wizard's castle. After traversing a plethora of magical traps and illusory walls, he finally spies the wizard's hidden stash of gems beyond the end of a long corridor. He hastily runs toward it, realizing only a moment too late that he has fallen into another trap.

As soon as the thief enters the corridor, a magical flame ignites behind him, and the corridor is divided into segments by thick walls of fog. A message from the wizard appears on the wall of the corridor, lit with a magical glow:

This corridor has 10 segments, each identical and symmetrical in appearance. The first has no special properties, but some of the remaining 9 will turn you around as soon as you enter them. You will feel nothing, but the way forward will become the way back. If you blindly continue, you will end up back where you started. Should you move between segments more than 30 times, you will be trapped in an alternate dimension.

None of the thief's navigational aids are working, and the corridor resists any attempt to mark it. How can the thief guarantee his escape from the labyrinth?

Woofmao
  • 1,580
  • 11
  • 21
  • 2
  • If you are turned around after entering a new segment, where will you end up exactly? How do you turn yourself back around and make progress in that situation?
  • – JS1 Jan 29 '20 at 02:10
  • 2
    If you move forward from A to B, and B is a reversing segment, you remain in B but going forward again will lead to A. You could move backward while in B and go to the next segment instead. – Woofmao Jan 29 '20 at 02:25
  • So you know where each segment's boundaries are? That is, it's a sequence of discrete steps? – Deusovi Jan 29 '20 at 03:24
  • Yes, you move through the labyrinth in discrete steps. – Woofmao Jan 29 '20 at 03:49
  • 3
    I gather that there is no way to distinguish between segments, apart from the initial one that you will recognize if you ever get back to it, right? – Arnaud Mortier Jan 29 '20 at 08:25
  • I think the problem description is similar to this one: https://puzzling.stackexchange.com/questions/91671/controlling-a-robot-blindfolded-on-a-9x9-grid , i.e., develop a sequence of steps that bring the thief to the target field, no matter where the magical turing segments are. – daw Jan 29 '20 at 12:44