Logic Dots puzzle problems with SWI-Prolog
问题 I am working on a logic game named "Logic Dots". The game is a 3*3 grid with numbers surrounding each row and column. The rule is easy that the sum of each row and column should equal to those numbers. Below is my code, it is changed from clpfd sokoku. But result is something wrong. Code: :- use_module(library(clpfd)). kakuro(Rows) :- length(Rows, 3), maplist(length_list(3), Rows), append(Rows, Vs), Vs ins 0..1, Rows = [A,B,C], sum(A,#=,1), sum(B,#=,1), sum(C,#=,1), transpose(Rows, Columns),