hey ive got quite a few small problems which im sure people will be able to help with easy...im not too good at prolog as im used to java and C. All are based on lists, here goes:
-Previous-to(X,Y,Z) where x and y is an element of the list Z, and x comes before y.
-number-occurances(X,Y,Z) where x is an element of y, and z is the number of times it occurs.
-delete-all(X,Y,Z) where x is an element of list y and z is the obtained list after deleting all occurrences of x in y.
-delete-all-even(X,Y,Z) where x is an element of list y, and z is the list obtained by deleting all X in Y if x is an even number, or only the first occurrence if it is an odd number.
Thank you for all your help, i really do appreciate it so much, and hopefully i will begin to understand prolog with peoples help.
Cheers
Andrew
-Previous-to(X,Y,Z) where x and y is an element of the list Z, and x comes before y.
-number-occurances(X,Y,Z) where x is an element of y, and z is the number of times it occurs.
-delete-all(X,Y,Z) where x is an element of list y and z is the obtained list after deleting all occurrences of x in y.
-delete-all-even(X,Y,Z) where x is an element of list y, and z is the list obtained by deleting all X in Y if x is an even number, or only the first occurrence if it is an odd number.
Thank you for all your help, i really do appreciate it so much, and hopefully i will begin to understand prolog with peoples help.
Cheers
Andrew