Skip to content

Instantly share code, notes, and snippets.

View eugeneia's full-sized avatar

Max Rottenkolber eugeneia

View GitHub Profile
;;;
;;; Yet another porting of Dr. Norvig's Sudoku Solver, in Common Lisp
;;;
;;; @nfunato 2017-12-31
;;; Please see the original article (http://norvig.com/sudoku.html) for detail.
;;; Note
;;;
;;; - I intentionally tried to keep the smell of the original code, except
;;; anaphoras and the like
(defmacro aif (tst thn &optional els) `(let ((it ,tst)) (if it ,thn ,els)))
(defmacro awhen (tst &body body) `(let ((it ,tst)) (when it ,@body)))
(defmacro aprog1 (f . fs) `(let ((it ,f)) ,@fs it))
(defmacro acond (&rest cls)
(if (null cls) nil
(let ((cl1 (car cls)) (sym (gensym)))
`(let ((,sym ,(car cl1)))
@rygorous
rygorous / box_pruning_notes.txt
Created February 17, 2017 00:41
Note on changes to the box pruning code.
Brief explanation what I did to get the speed-up, and the thought process behind it.
The original code went:
EnterLoop:
movaps xmm3, xmmword ptr [edx+ecx*2] // Box1YZ
cmpnltps xmm3, xmm2
movmskps eax, xmm3
cmp eax, 0Ch