Where the question includes a partial program, you are advised to copy and paste this into a file. You should develop all your solutions on a machine and test them before looking at the solutions.
Given the following queries, your procedure should give the following results:
| ?- delete_nth1(1, 3, [a,b,c,d,e], List).
List = [a,b,d,e] ? ;
no
| ?- delete_nth1(1, Pos, [a,b,c,d,e], [a,b,d,e]).
Pos = 3 ? ;
no
| ?- delete_nth1(1, 3, List, [a,b,d,e]).
List = [a,b,_14266,d,e] ? ;
no
These Pages are maintained by
Dr Peter Hancox
Last updated October 1998