Skip to content

Instantly share code, notes, and snippets.

@swannodette
Forked from fogus/seqs.prolog
Created March 9, 2011 20:46
Show Gist options
  • Save swannodette/862974 to your computer and use it in GitHub Desktop.
Save swannodette/862974 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