Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % length of the list
- len([], 0).
- len([H|T], B) :-len(T, NT), B is NT + 1.
- % return the ith element of the list
- match([H|_],0,H) :-!.
- match([_|T],N,H) :-N > 0,N1 is N-1,match(T,N1,H).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement