Created
December 23, 2018 05:47
-
-
Save DonaldKellett/a928d758d870079a491e2c0ed2322a5c to your computer and use it in GitHub Desktop.
Learn Prolog Now! - Chapter 6 - Exercise 6.4.2 - Last element of a list using recursion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
last([X], X). | |
last([_ | T], X) :- last(T, X). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment