Skip to content

Instantly share code, notes, and snippets.

@fogus
Created March 9, 2011 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save fogus/862962 to your computer and use it in GitHub Desktop.
Save fogus/862962 to your computer and use it in GitHub Desktop.
nthr(1, [X|_], X).
nthr(I, [_|Y], Z) :- N is I - 1,
nthr(N, Y, Z).
% :- nthr(3, [a,b,c], X).
% X = c ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment