Skip to content

Instantly share code, notes, and snippets.

@DonaldKellett
Created December 22, 2018 16:40
Show Gist options
  • Save DonaldKellett/fd9c000896d73d186f8c6ddca46f53f5 to your computer and use it in GitHub Desktop.
Save DonaldKellett/fd9c000896d73d186f8c6ddca46f53f5 to your computer and use it in GitHub Desktop.
Learn Prolog Now! - Chapter 5 - Exercise 5.3 - Increment each element in the list
addone([], []).
addone([X | L0], [Y | L1]) :- Y is X + 1, addone(L0, L1).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment