Skip to content

Commit 12d9cf8

Browse files
authored
Merge pull request #3 from JesseAldridge/patch-1
Add comment explaining how to use it.
2 parents 3c21997 + 84720f9 commit 12d9cf8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: sendmoremoney.pl

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
:- use_module(library(clpfd)).
2-
puzzle([S,E,N,D] + [M,O,R,E] = [M,O,N,E,Y]) :- Vars = [S,E,N,D,M,O,R,Y], Vars ins 0..9, all_different(Vars), S*1000 + E*100 + N*10 + D + M*1000 + O*100 + R*10 + E #= M*10000 + O*1000 + N*100 + E*10 + Y, M #\= 0, S #\= 0.
2+
puzzle([S,E,N,D] + [M,O,R,E] = [M,O,N,E,Y]) :- Vars = [S,E,N,D,M,O,R,Y], Vars ins 0..9, all_different(Vars), S*1000 + E*100 + N*10 + D + M*1000 + O*100 + R*10 + E #= M*10000 + O*1000 + N*100 + E*10 + Y, M #\= 0, S #\= 0.
3+
4+
% Usage: ?- puzzle(As + Bs = Cs), label(As).

0 commit comments

Comments
 (0)