Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
% from lecture app([],L,L). app([H|T],L2,[H|L]) :- app(T,L2,L). ins(E, List, R) :- R = R1, app([E], R4, R3), app(R2, R4, List), app(R2, R3, R1). % moved here from the below R= R1, shuffle(L,[]):- L = []. shuffle([H|L], R) :- R2 = R3, shuffle(L, R3), R = R1, ins(H, R2, R1). permute(L1, L2) :- L1 = R, shuffle(L2, R). check([H|T]) :- T= [H, H]. %sudoku([I0J0|I0List1], [I1J0|I1List1], [I2J0|I2List1],[I3J0|I3List1]):- sudoku([Row0|Rows1t3]) :- [Row1|Rows2t3] = Rows1t3, [Row2|Row3List] = Rows2t3, [Row3|_] = Row3List, [I0J0|I0List1] = Row0, [I1J0|I1List1] = Row1, [I2J0|I2List1] = Row2, [I3J0|I3List1] = Row3, permute([I0J0|I0List1], [1,2,3,4]), permute([I1J0|I1List1], [1,2,3,4]), permute([I2J0|I2List1], [1,2,3,4]), permute([I3J0|I3List1], [1,2,3,4]), [I0J1|I0List2] = I0List1, [I1J1|I1List2] = I1List1, [I2J1|I2List2] = I2List1, [I3J1|I3List2] = I3List1, [I0J2|I0List3] = I0List2, [I1J2|I1List3] = I1List2, [I2J2|I2List3] = I2List2, [I3J2|I3List3] = I3List2, [I0J3|_] = I0List3, [I1J3|_] = I1List3, [I2J3|_] = I2List3, [I3J3|_] = I3List3, permute([I0J0, I0J1, I1J0, I1J1], [1,2,3,4]), permute([I0J2, I0J3, I1J2, I1J3], [1,2,3,4]), permute([I2J0, I2J1, I3J0, I3J1], [1,2,3,4]), permute([I2J2, I2J3, I3J2, I3J3], [1,2,3,4]), permute([I0J0, I0J1, I0J2, I0J3], [1,2,3,4]), permute([I1J0, I1J1, I1J2, I1J3], [1,2,3,4]), permute([I2J0, I2J1, I2J2, I2J3], [1,2,3,4]), permute([I3J0, I3J1, I3J2, I3J3], [1,2,3,4]).