I have this question :
I need to create a paradict "rightGuesses" which will get 3 arguments, each one of them is a list of letters,
- The list of guessed letters
- The word i have to guess
- The letters that where guessed so far.
For example :
rightGuesses([n,o,p,q], [p,r,o,l,o,g], Ans).
will give us
Ans = [p, -, o, -, o, -].
I made:
rightGuesses([],T2,[ANS])
rightGuesses([A|T1],T2,[ANS]):-
(member(A,T2))=\=true,
rightGuesses(T1,T2,[ _ |'-']).
rightGuesses([A|T1],T2,[ANS]):-
member(A,T2),
rightGuesses(T1,T2,[ _ |A]).
But I get :
ERROR: c:/users/leonid/desktop/file3.pl:5:0: Syntax error: Operator expected Warning: c:/users/leonid/desktop/file3.pl:6:
When I try to compile it what is my problem, and is there is a better way to do it ?
` – false Apr 20 '14 at 20:55