Skip to content

Instantly share code, notes, and snippets.

@brikis98
Created April 9, 2014 09:06
Show Gist options
  • Select an option

  • Save brikis98/10244853 to your computer and use it in GitHub Desktop.

Select an option

Save brikis98/10244853 to your computer and use it in GitHub Desktop.
sort_list(Input, Output) :-
permutation(Input, Output),
check_order(Output).
check_order([]).
check_order([Head]).
check_order([First, Second | Tail]) :-
First =< Second,
check_order([Second | Tail]).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment