Skip to content

Instantly share code, notes, and snippets.

@DonaldKellett
Created December 23, 2018 05:55
Show Gist options
  • Save DonaldKellett/2e031624f464914d88399379890d68d6 to your computer and use it in GitHub Desktop.
Save DonaldKellett/2e031624f464914d88399379890d68d6 to your computer and use it in GitHub Desktop.
Learn Prolog Now! - Chapter 6 - Exercise 6.5 - Swap first and last element
swapfl(List1, List2) :- append([A | M], [B], List1), append([B | M], [A], List2).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment