Challenge #5: The Bears and the Maiden Fair

The final challenge of 2013 is part puzzle, part story, and part game!

An evil wizard has locked the princess in the dungeon. Luckily, she had a hairpin, and used it to pick the lock and escape from her cell.  Now, she’s trying to make her way out of the dungeon. (See a static map of the dungeon below or an interactive one here!)

The princess starts at the squared labeled P, on the 1st floor.

The goal is to get the ladder on the 6th floor. It’s the square marked with the L.

The princess can move up, down, left, or right. She can’t move diagonally.

Since the dungeon has no stairs or elevators (or escalators), the princess has to use the Warp Squares to get around. The Warp Squares come in numbered pairs. The princess can warp between these pairs. So, if the princess is on the square marked W1 on the 1st floor, she can warp to the square marked W1 on 4th floor. A warp counts as one move.

The dungeon also has a few hazards. The black squares are black holes and if the princess moves into one, she will be crushed.

There are also several bears. The princess is nimble, but she can only move so fast. If she ever occupies the same square as a bear, she will get eaten up. She can, however, safely slip past a bear as long as they aren’t on the same square.

Every time the princess moves (up, down, left, right, or warp), the bears also move.  Each bear loops through a set movement pattern.  The bear will repeat the same movement pattern over and over, from the beginning. The movement patterns (figured out by the princess) are listed below:

Bear 1: Up, Right, Down, Left

Bear 2: Up, Left, Down, Left, Right, Right

Bear 3: Left, Left, Right, Right

Bear 4: Up, Right, Down, Left

Bear 5: Right, Up, Up, Up, Left, Down, Down, Down

Bear 6: Right, Right, Right, Right, Right, Left, Left, Left, Left, Left

Bear 7: Up, Up, Right, Right, Right, Down, Down, Left, Left, Left

Bear 8: Left, Right

How can the princess escape the maze? Provide a list of all the moves she must make. (Note: Instead of writing out up, down, left, right, and warp, you can write U, D, L, R, and W.)

1stfloor
1st Floor
2ndfloor
2nd Floor
3rdfloor
3rd Floor
4th Floor
4th Floor
5thfloor
5th Floor
6thfloor
6th Floor