If you are REALLY confused about paths, let me tell you a way that solves it 100%, although it is painstakingly long and meticulous. It's called Dijkstra's path finding algorithm and it's used in many computer programs which involve finding paths.
Here is how you do it - pick the goal first. It can be one square or many. This is where you want to go or where you want the roach to go. Pick the start too. For example, you are Beethro and you are in the bottom half of the last room you showed, you want to get to the middle - the X is your goal, Beethro is your start. Paint your goal in a color. This is your current color.
Now follow the following steps:
1. Look at all the tiles which have "
current color"
. For each such tile, find all the adjacent tiles which you can step into the current colored tile FROM. Paint them in "
next color"
. Don't paint any tiles which are already painted.
2. The "
next color"
you used in 1 is now your "
current color"
. Pick some new color to be the new "
next color"
.
3. Repeat from step 1 until start is reached. You now have a solid path from start to goal.
Diagram attached though is really horrible quality.
I solved it for Beethro going to middle, and then for roach going to middle. Keep in mind that for the roach you assume that Beethro is on the bottom, so you cannot paint tiles below "
current color"
tiles, because the roach never goes up. Also, roaches pick vertical over horizontal which should also be kept in mind (the botched part in blue is where I made a mistake).
Anyway, hope that helps. Here is the diagram:
Click here to view the secret text
×
Note that it finds
A path, not the
only path. It also varies depending on which tiles you check first, but it does always find one of the shortest possible paths to the goal.
____________________________
Slay the living! Raise the dead!
Paint the sky in crimson red!
[Last edited by Maurog at 09-04-2011 03:43 AM]