Results 1 to 2 of 2

Thread: A-Star (A*) Path Finding Visual Test

  1. #1

    Thread Starter
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497

    A-Star (A*) Path Finding Visual Test

    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
    Attached Images Attached Images  
    Attached Files Attached Files
    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)

  2. #2
    Lively Member
    Join Date
    Mar 2015
    Posts
    104

    Re: A-Star (A*) Path Finding Visual Test

    Now, if I enter a maze I'll never get lost. Great stuff.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width