Plaster
New
List
Login
common-lisp
default
anonymous
2018.05.07 09:01:41
(defun eliminate (square digit) (without-contradictions (when (candidate digit square) (remove-candidate digit square) (if (or (no-candidates square) (and (single-candidate square) (notevery (curry 'eliminate (single-candidate square)) (peers square)))) (contradiction) (dolist (unit (units square)) (let ((dplaces (square-candidates digit unit))) (when (or (no-candidates dplaces) (and (single-candidate dplaces) (not (assign (single-candidate dplaces) digit)))) (contradiction))))))))
Raw
Annotate
Repaste
Edit