Prolog implementation of SEND + MORE = MONEY isn't finding a result

Advertisements I’m getting started with Prolog, and decided to try the famous SEND+MORE=MONEY puzzle, as it seemed fairly straightforward. However, my implementation does find a result. Can anyone see what I did wrong? smm([S, E, N, D, M, O, R, Y]) :- maplist(between(0, 9), [S, E, N, D, M, O, R, Y]), Line1 is S*1000… Read More Prolog implementation of SEND + MORE = MONEY isn't finding a result

Why is this code in PROLOG giving me a syntax error?

Advertisements col_tri(Vars):- Vars=[X1,X2,X3], Vars in 1..3, X1#\=X2, X1#\=X3, X2#\=X3, label(Vars). This code is giving me this error in line 2 (Vars in 1..3,): ERROR: c:/users/xxxx/desktop/prolog/tp2.pl:2:20: Syntax error: Operator expected >Solution : Operators are things like the + in 1 + 1, and in your code the in in Vars in 1..3. Prolog code can define… Read More Why is this code in PROLOG giving me a syntax error?