This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
sc330_f2016:sudoku [2016/10/26 16:39] wingated |
sc330_f2016:sudoku [2016/10/28 22:34] dcostello |
||
---|---|---|---|
Line 8: | Line 8: | ||
% If we reach the end of the board with this scheme, it means that | % If we reach the end of the board with this scheme, it means that | ||
% the whole thing is solved. | % the whole thing is solved. | ||
+ | |||
+ | % YOU SHOULD FILL IN THE SOLVE PROCEDURE, DOWN BELOW. | ||
digit(1). | digit(1). | ||
Line 53: | Line 55: | ||
% for `getCube`. | % for `getCube`. | ||
% drop: (InputList, NumToDrop, ResultList) | % drop: (InputList, NumToDrop, ResultList) | ||
- | drop([], _, []). | + | drop([], _, []):-!. |
- | drop(List, 0, List). | + | drop(List, 0, List):-!. |
drop([_|Tail], Num, Rest) :- | drop([_|Tail], Num, Rest) :- | ||
Num > 0, | Num > 0, | ||
Line 63: | Line 65: | ||
% for `getCube`. | % for `getCube`. | ||
% take: (InputList, NumToTake, ResultList) | % take: (InputList, NumToTake, ResultList) | ||
- | take([], _, []). | + | take([], _, []):-!. |
- | take(_, 0, []). | + | take(_, 0, []):-!. |
take([Head|Tail], Num, [Head|Rest]) :- | take([Head|Tail], Num, [Head|Rest]) :- | ||
Num > 0, | Num > 0, |