Prolog Question
Posted
by Dan
on Stack Overflow
See other posts from Stack Overflow
or by Dan
Published on 2010-05-03T21:05:49Z
Indexed on
2010/05/03
21:08 UTC
Read the original article
Hit count: 137
prolog
Assume the third parameter is the result.
a( 1, [Hd | Tl], Hd ). a( N, [ | Tl], Elem ) :- N > 1, N1 is N - 1, a( N1, Tl, Elem).
© Stack Overflow or respective owner