Another ghost has trespassed into your haunted mansion. You are able to force him out, but only once you've caught up to him.
Both you and the other ghost take turns. During your turn, you may either stay in the same room, or move through a wall ceiling or floor to an adjacent room within the mansion (no moving diagonally). The other ghost does the same. You can sense each other's positions. The other ghost chooses the starting positions.
Given the above map of the mansion, can you catch the trespasser, or can he evade you indefinitely? Show a way to figure out the outcome of any given mansion.
(In reply to
re: Gotcha! by Dej Mar)
It's true the other ghost doesn't have to move, so let's see...
Pred Prey
G A (If he stays here he's caught)
G B (Prey stays in B)
A F (Prey can't stay in B, now F is only safe move)
I H (Prey can't stay in F, H is only safe move)
J H (Trapped)
G C (Prey stays in C)
D B (Prey can't stay in C, B is only safe move)
A F (Prey can't stay in B, F is only safe move)
I H (Prey can't stay in F, H is only safe move)
J H (Trapped)
G D (If he stays here he's caught)
G E (If he stays here he's caught)
G F (If he stays here he's caught)
G H (If he stays here he's caught)
G I (If he stays here he's caught)
G J (If he stays here he's caught)