First of all let me apologize for posting in the wrong forum ... but I didn't find one for prolog... please redirect me if we have one ... and anyone's response if he/she knows the answer is appreciated.
am trying to print the elements of a list.... one per line using a predicate of arity 1 .... which I am able to do with the code:
The problem is: I want to have the sequence number of the list element in front of it: For example,
I am not able to able to do that.
The code I am writing is:
11 ?- display_list([north, south, east]).
The list is empty
Also I keep on getting this 'The list is empty' everytime the elements are exhausted and not only when the input list is empty .....
Please advice ...... Thanks
|All times are GMT +5.5. The time now is 08:24.|