Created
June 4, 2014 16:40
-
-
Save Falci/470763d15ef333f21a7d to your computer and use it in GitHub Desktop.
Criar lista em Prolog
This file contains 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
criarLista(X, R) :- | |
criarLista(X, [], R). | |
criarLista(2, L, R) :- | |
R = '.'(2,L), | |
!. | |
criarLista(X, L, R) :- | |
T = '.'(X, L), | |
Xn is X -1, | |
criarLista(Xn, T, R). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment