Currently I am writing a Prolog program dealing with various different ways to get from one location to another and calculating the distances of these paths.
So far, I have been hard-coding my data clauses into my code as a quick work-around for testing purposes, but I need to write my code in such a way that a data file with the appropriately formatted data could be read into the program.
For example,
path(1, 4).
setRoutes([[1, 2, 45], [1, 3, 135],
[2, 4,135], [3, 4, 45]] ).
will be the format of the inputted data, so I've hard-coded this into my program. The following isn't part of the input data, but I also hard-coded it for use in my program. How would I make the actual inputted information 'generic' while also making my own code 'generic' with respect to the original input?
linkedPoints(1, 2).
linkedPoints(1, 3).
linkedPoints(2, 4).
linkedPoints(3, 4).
My question is: how do I get from having to hard-code data into the program itself to creating "templates" that will read in user-inputted or file-inputted data?
Let me know if I need to clarify this at all... Thanks for the help!