Skip to content

Instantly share code, notes, and snippets.

@metaperl
Created December 31, 2010 19:10
Show Gist options
  • Select an option

  • Save metaperl/761259 to your computer and use it in GitHub Desktop.

Select an option

Save metaperl/761259 to your computer and use it in GitHub Desktop.
% http://sites.google.com/site/prologsite/prolog-problems/1
% working on 1.08
compress([], []).
compress([X,Y], [X,Y]) :- X /= Y.
compress([X,Y], [X]) :- X = Y.
% problems writing other clauses
compress([X,Y|Z], [X,Y]) :- X /= Y.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment