Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.