|
Self-Test 6
|
| Terminate when a specified position is reached | ||
| 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. | ||
Task 1: adding to position/3 |
||
| The procedure position/3 was given in the Module as: | ||
|
||
| Add one clause to this procedure for which the position is zero if the list to be searched is empty. Try the following queries to get these solutions: | ||
|
||