February 26th, 2006, 11:03 AM
Join Date: Apr 2005
Time spent in forums: 9 h 53 m 53 sec
Reputation Power: 0
Prolog - Find missing elements of an ordered list
I am trying to write a predicate that accepts a list of integers. It sorts this list and then determines if there are any gaps in the sequence:
? - game([2,6,7,5],X).
X = [3,4]
Here is what I have so far:
Test is H +1,
Test != Final,
game(List,Result) :- sort(List,Result), find_hole(Result,Done).
Any idea on what I am doing wrong?
Thanks for your help