February 26th, 2006, 11:03 AM
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:
Any idea on what I am doing wrong?
Test is H +1,
Test != Final,
game(List,Result) :- sort(List,Result), find_hole(Result,Done).
Thanks for your help