% 16 solutions stest1 :- P0 = ['1', [[0,0,1,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,0],[0,0,1,1,0,0]]], P1 = ['2', [[0,0,1,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,0],[0,1,0,0,1,0]]], P2 = ['3', [[1,1,0,0,1,1],[1,1,0,0,1,1],[1,1,0,1,0,1],[1,1,0,0,1,1]]], P3 = ['4', [[1,0,1,1,0,1],[1,1,0,1,0,1],[1,1,0,1,0,1],[1,1,0,0,1,1]]], P4 = ['5', [[0,0,1,1,0,0],[0,0,1,1,0,0],[0,0,1,1,0,0],[0,1,0,1,0,0]]], P5 = ['6', [[0,1,0,1,0,0],[0,1,0,0,1,0],[0,1,0,1,0,0],[0,1,0,0,1,0]]], findall(S, puzzle([P0, P1, P2, P3, P4, P5], S), Ss), length(Ss, N), format('~w~n', N). % 8 solutions stest2 :- P0 = ['1', [[0,0,1,1,0,0],[0,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0]]], P1 = ['2', [[1,1,0,0,1,0],[0,0,1,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,1]]], P2 = ['3', [[1,0,1,1,0,0],[0,1,0,0,1,1],[1,0,1,0,1,1],[1,0,1,0,1,1]]], P3 = ['4', [[1,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,1]]], P4 = ['5', [[1,1,0,0,1,0],[0,1,0,1,0,1],[1,1,0,0,1,1],[1,1,0,0,1,1]]], P5 = ['6', [[0,0,1,0,1,0],[0,0,1,1,0,0],[0,1,0,0,1,0],[0,1,0,1,0,0]]], findall(S, puzzle([P0, P1, P2, P3, P4, P5], S), Ss), length(Ss, N), format('~w~n', N). % 16 solutions stest3 :- P0 = ['1', [[0,0,1,1,0,0],[0,1,1,0,1,0],[0,0,1,1,0,0],[0,1,0,0,1,0]]], P1 = ['2', [[0,0,0,1,0,0],[0,1,0,0,1,0],[0,1,0,0,1,0],[0,0,1,0,0,0]]], P2 = ['3', [[1,1,0,0,1,1],[1,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,1]]], P3 = ['4', [[1,1,0,0,1,1],[1,1,0,0,1,1],[1,1,0,0,1,1],[1,1,0,1,1,1]]], P4 = ['5', [[0,0,1,1,0,0],[0,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0]]], P5 = ['6', [[1,1,0,0,1,1],[1,0,1,1,0,0],[0,0,1,1,0,0],[0,0,1,1,0,1]]], findall(S, puzzle([P0, P1, P2, P3, P4, P5], S), Ss), length(Ss, N), format('~w~n', N). % 8 solutions stest4 :- P0 = ['1', [[0,0,1,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,0],[0,1,0,0,1,0]]], P1 = ['2', [[1,1,0,1,0,1],[1,1,0,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,1]]], P2 = ['3', [[0,0,1,1,0,1],[1,1,0,0,1,1],[1,1,0,0,1,0],[0,1,0,1,0,0]]], P3 = ['4', [[0,0,1,1,0,1],[1,1,0,0,1,1],[1,1,0,0,1,1],[1,1,0,0,1,0]]], P4 = ['5', [[0,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0],[0,0,1,1,0,0]]], P5 = ['6', [[1,0,1,1,0,0],[0,1,0,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,1]]], findall(S, puzzle([P0, P1, P2, P3, P4, P5], S), Ss), length(Ss, N), format('~w~n', N). % 6 solutions stest5 :- P0 = ['1', [[0,0,1,1,0,0],[0,1,0,0,1,0],[0,1,0,0,1,1],[1,1,0,0,1,0]]], P1 = ['2', [[0,0,1,0,1,1],[1,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0]]], P2 = ['3', [[0,0,1,1,0,0],[0,0,1,1,0,1],[1,1,0,1,0,0],[0,0,1,1,0,0]]], P3 = ['4', [[0,0,1,1,0,0],[0,0,1,0,1,1],[1,1,0,0,1,1],[1,1,0,1,0,0]]], P4 = ['5', [[1,1,0,0,1,1],[1,1,0,0,1,1],[1,1,0,0,1,0],[0,0,1,0,1,1]]], P5 = ['6', [[0,1,0,1,0,0],[0,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0]]], findall(S, puzzle([P0, P1, P2, P3, P4, P5], S), Ss), length(Ss, N), format('~w~n', N). % 4 solutions stest6 :- P0 = ['1', [[0,1,0,0,1,0],[0,0,1,1,0,0],[0,0,1,1,0,0],[0,0,1,1,0,0]]], P1 = ['2', [[0,0,1,1,0,0],[0,0,1,1,0,1],[1,1,0,0,1,0],[0,1,0,0,1,0]]], P2 = ['3', [[1,0,1,1,0,0],[0,0,1,1,0,0],[0,0,1,1,0,0],[0,1,0,0,1,1]]], P3 = ['4', [[1,1,0,0,1,1],[1,1,0,0,1,0],[0,1,0,1,0,1],[1,1,0,1,0,1]]], P4 = ['5', [[0,0,1,1,0,0],[0,1,0,1,0,1],[1,1,0,0,1,1],[1,0,1,1,0,0]]], P5 = ['6', [[0,1,0,0,1,0],[0,1,0,0,1,1],[1,1,0,0,1,0],[0,1,0,1,0,0]]], findall(S, puzzle([P0, P1, P2, P3, P4, P5], S), Ss), length(Ss, N), format('~w~n', N).