The purpose of this was to create a working A-Star path finding program that I could play with to be sure I have the algorithm right.
I have it working, so now I share. =)
When you point at a square, it tests to see if there's a valid path to the end. If there is, it highlights the path and lets you click to square to add a wall. (Click a wall to remove it).
If there's no valid path, it won't let you add a wall.
Play with the variables in the global section of Form1.cs for additional options (square size, show labels, grid size)
This project was created in VS2008 but it has no VS-specific code nor version-specific code. If you are using a different IDE, just add the CS files to your own project and you should be good to go.
Finally, the purpose I needed it for, only left right up and down were valid so I don't check diagonals. You can easily add them though.
Just modify this line:
int[] IdentityOffsetList = new int[] {-1, +1, -GridSize, GridSize}; //One square left, right, up, down
Last edited by Lord_Rat; Dec 13th, 2010 at 04:22 PM.
Need to re-register ASP.NET?
C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i
(Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)