need a function for c language
-
hi, i am learning c code, and i am looking for a function 2 calculate the short way in a map, does anyone have such function, thx:-D:laugh::laugh::laugh::laugh::laugh:
-
hi, i am learning c code, and i am looking for a function 2 calculate the short way in a map, does anyone have such function, thx:-D:laugh::laugh::laugh::laugh::laugh:
I think this will depend a lot of how your map is implemented. You know, if I had to respond to your question like it is asked, the response is simple: it's the straigh line !! But I suppose it's not the solution you want to hear isn't it ;P ? So try to be a little bit more precise... You can also look for the A* pathfinding algorithm (a google search gave me these links[^] Maybe it will be helpfull...
-
isn't the shortest way between two points the line ? :-D:laugh:;P:cool:
TOXCCT >>> GEII power
[toxcct][VisualCalc]I think we were thinking the same thing :laugh:
-
isn't the shortest way between two points the line ? :-D:laugh:;P:cool:
TOXCCT >>> GEII power
[toxcct][VisualCalc]yep,i mean there are lotz of points, find the shortest way bewteen 2 points
-
I think this will depend a lot of how your map is implemented. You know, if I had to respond to your question like it is asked, the response is simple: it's the straigh line !! But I suppose it's not the solution you want to hear isn't it ;P ? So try to be a little bit more precise... You can also look for the A* pathfinding algorithm (a google search gave me these links[^] Maybe it will be helpfull...
first of all, i am using dos second , there a lot of points, there r different distance bewteen 2 points, and i need a function 2 calculate the shortest path bewteen 2 given points
-
first of all, i am using dos second , there a lot of points, there r different distance bewteen 2 points, and i need a function 2 calculate the shortest path bewteen 2 given points
THX FOR THE HELP!!!!!!!;);););););););););)
-
THX FOR THE HELP!!!!!!!;);););););););););)
BY THE WAY, DO U HAVE THE SOURCE CODE FOR C OR C++, THX:-O
-
BY THE WAY, DO U HAVE THE SOURCE CODE FOR C OR C++, THX:-O
I have implemented this algorithm but for a specific application (a game in fact). But I was using hexagonal cells and the distance between two 'cells' was always 1 in my case. So I think your implementation will be very different... But I can send you what I've done if you want to have an example... I don't have it here so I will send it to you when I'm back home. Just give me your e-mail adress. Also, there are plenty of examples on the web and I think once I saw an example that was describing exactly the scheme you are asking for: the distance between two points is not equidistant (and there you'll have to play with the weight of the path between the two points).
-
I have implemented this algorithm but for a specific application (a game in fact). But I was using hexagonal cells and the distance between two 'cells' was always 1 in my case. So I think your implementation will be very different... But I can send you what I've done if you want to have an example... I don't have it here so I will send it to you when I'm back home. Just give me your e-mail adress. Also, there are plenty of examples on the web and I think once I saw an example that was describing exactly the scheme you are asking for: the distance between two points is not equidistant (and there you'll have to play with the weight of the path between the two points).
THX, MY EMAIL IS zhuangfanyin@hotmail.com:laugh:
-
THX, MY EMAIL IS zhuangfanyin@hotmail.com:laugh:
u might want to take a look at dijkstra's algorithm. google it and take the first link.