Skip to content

Instantly share code, notes, and snippets.

@FabienArcellier
Last active December 11, 2015 05:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FabienArcellier/4555952 to your computer and use it in GitHub Desktop.
Save FabienArcellier/4555952 to your computer and use it in GitHub Desktop.
Build a new list which is the same than the list given as param and add 0 at the end
% Appel cstl([1,2,3], Y]) % -> Y=[1|[2|[3|[0]]]]
cstl([], Result):- Result = [0].
cstl([Y|L], Result):- cstl(L, Result1), Result = [Y| Result1].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment