Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Find route in a system 1

Status
Not open for further replies.

vbx

Programmer
Dec 12, 2010
18
RO
Cann someone help me how to find path of a route in sistem,like: if i have a route from A to B i need to get all the cities that traverse from A to B ? how can thsi be done ? thanks
 
Ohh yes,I completely forgot about that. It works now

PS: glad to be co-nationals :) Thanks for helping a beginer. I am done with the questions for now,sorry for the stress :)
 
Glad to help. Without that rule, recursivity doesn't end. Prolog will successively shorten the list and will arrive at an empty list and no rule will tell it how to get the minimum out of that list, so it will fail. We have to provide the answer manually when the list gets to be 1-element long, because it's easy for us to know the answer at that point, without relying on recursivity.
 
I was used to C and C++ ,but i had to study prolog in the past 9 days for a school project,so i am not use to it :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top