A * Algorithm - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

A * Algorithm

JsterJster Posts: 6Member
I'm looking to see a simple demonstration of the A Star Algorithm in C#. Can any one direct me to some good information. I did download a project from this site that did the a *, but it was missing a file so I wasn't able to see how it was implemented.

Thanks,
J

Comments

  • IDKIDK Posts: 1,784Member
    : I'm looking to see a simple demonstration of the A Star Algorithm in C#. Can any one direct me to some good information. I did download a project from this site that did the a *, but it was missing a file so I wasn't able to see how it was implemented.
    :
    : Thanks,
    : J
    :
    This is the algorithm for it:
    1. See what's before, is it equall then procced.
    2. Scan for what's after, if found, it's a match.
  • weiccoweicco Posts: 950Member
    : I'm looking to see a simple demonstration of the A Star Algorithm in C#. Can any one direct me to some good information. I did download a project from this site that did the a *, but it was missing a file so I wasn't able to see how it was implemented.
    :
    : Thanks,
    : J
    :

    I've used regular expression for that. Like this:

    [code]
    string pattern = "foo*.jpg";
    string haystack = "foo_bar.jpg";
    string regexPattern = pattern.Replace("*", "(.*?)");
    Regex regex = new Regex(regexPattern);

    if (regex.Matches(haystack))
    {
    MessageBox.Show("Match found: " + haystack);
    }
    [/code]
Sign In or Register to comment.