diff options
| author | Glenn Morris | 2011-05-23 20:36:06 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-05-23 20:36:06 -0700 |
| commit | eb8a5e9b13d1536dc7a9ac8795917dd768a372ed (patch) | |
| tree | ef883af7d1d52f0f2311595b400327885e587f5e | |
| parent | a2a25d24350857dda87e28d6b2695cccc41bb32e (diff) | |
| download | emacs-eb8a5e9b13d1536dc7a9ac8795917dd768a372ed.tar.gz emacs-eb8a5e9b13d1536dc7a9ac8795917dd768a372ed.zip | |
Small cleanup of recent 5x5.el changes.
* lisp/play/5x5.el (5x5-log-init, 5x5-log): Evaluate when compiling.
(5x5-log-init, 5x5-log, 5x5-solver): Doc fixes.
(math-map-vec, math-sub, math-mul, math-make-intv, math-reduce-vec)
(math-format-number, math-pow, calcFunc-arrange, calcFunc-cvec)
(calcFunc-diag, calcFunc-trn, calcFunc-inv, calcFunc-mrow)
(calcFunc-mcol, calcFunc-vconcat, calcFunc-index): Declare.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/play/5x5.el | 26 |
2 files changed, 31 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ce0f3e8733b..3f050faee13 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2011-05-24 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * play/5x5.el (5x5-log-init, 5x5-log): Evaluate when compiling. | ||
| 4 | (5x5-log-init, 5x5-log, 5x5-solver): Doc fixes. | ||
| 5 | (math-map-vec, math-sub, math-mul, math-make-intv, math-reduce-vec) | ||
| 6 | (math-format-number, math-pow, calcFunc-arrange, calcFunc-cvec) | ||
| 7 | (calcFunc-diag, calcFunc-trn, calcFunc-inv, calcFunc-mrow) | ||
| 8 | (calcFunc-mcol, calcFunc-vconcat, calcFunc-index): Declare. | ||
| 9 | |||
| 1 | 2011-05-24 Stefan Monnier <monnier@iro.umontreal.ca> | 10 | 2011-05-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 11 | ||
| 3 | Add an :exit-function for completion-at-point. | 12 | Add an :exit-function for completion-at-point. |
diff --git a/lisp/play/5x5.el b/lisp/play/5x5.el index a5f585d4d86..75f7c2df009 100644 --- a/lisp/play/5x5.el +++ b/lisp/play/5x5.el | |||
| @@ -490,6 +490,7 @@ position." | |||
| 490 | (cdr x)))) | 490 | (cdr x)))) |
| 491 | (cdr grid-matrix)))) | 491 | (cdr grid-matrix)))) |
| 492 | 492 | ||
| 493 | (eval-and-compile | ||
| 493 | (if nil; set to t to enable solver logging | 494 | (if nil; set to t to enable solver logging |
| 494 | (progn | 495 | (progn |
| 495 | (defvar 5x5-log-buffer nil) | 496 | (defvar 5x5-log-buffer nil) |
| @@ -499,7 +500,7 @@ position." | |||
| 499 | (setq 5x5-log-buffer (get-buffer-create "*5x5 LOG*")))) | 500 | (setq 5x5-log-buffer (get-buffer-create "*5x5 LOG*")))) |
| 500 | 501 | ||
| 501 | (defun 5x5-log (name value) | 502 | (defun 5x5-log (name value) |
| 502 | "Debug purpuse only. | 503 | "Debug purposes only. |
| 503 | 504 | ||
| 504 | Log a matrix VALUE of (mod B 2) forms, only B is output and | 505 | Log a matrix VALUE of (mod B 2) forms, only B is output and |
| 505 | Scilab matrix notation is used. VALUE is returned so that it is | 506 | Scilab matrix notation is used. VALUE is returned so that it is |
| @@ -516,19 +517,36 @@ easy to log a value with minimal rewrite of code." | |||
| 516 | (insert name ?= value-to-log ?\n)))) | 517 | (insert name ?= value-to-log ?\n)))) |
| 517 | value)) | 518 | value)) |
| 518 | (defmacro 5x5-log-init ()) | 519 | (defmacro 5x5-log-init ()) |
| 519 | (defmacro 5x5-log (name value) value)) | 520 | (defmacro 5x5-log (name value) value))) |
| 521 | |||
| 522 | (declare-function math-map-vec "calc-vec" (f a)) | ||
| 523 | (declare-function math-sub "calc" (a b)) | ||
| 524 | (declare-function math-mul "calc" (a b)) | ||
| 525 | (declare-function math-make-intv "calc-forms" (mask lo hi)) | ||
| 526 | (declare-function math-reduce-vec "calc-vec" (a b)) | ||
| 527 | (declare-function math-format-number "calc" (a &optional prec)) | ||
| 528 | (declare-function math-pow "calc-misc" (a b)) | ||
| 529 | (declare-function calcFunc-arrange "calc-vec" (vec cols)) | ||
| 530 | (declare-function calcFunc-cvec "calc-vec" (obj &rest dims)) | ||
| 531 | (declare-function calcFunc-diag "calc-vec" (a &optional n)) | ||
| 532 | (declare-function calcFunc-trn "calc-vec" (mat)) | ||
| 533 | (declare-function calcFunc-inv "calc-misc" (m)) | ||
| 534 | (declare-function calcFunc-mrow "calc-vec" (mat n)) | ||
| 535 | (declare-function calcFunc-mcol "calc-vec" (mat n)) | ||
| 536 | (declare-function calcFunc-vconcat "calc-vec" (a b)) | ||
| 537 | (declare-function calcFunc-index "calc-vec" (n &optional start incr)) | ||
| 520 | 538 | ||
| 521 | (defun 5x5-solver (grid) | 539 | (defun 5x5-solver (grid) |
| 522 | "Return a list of solutions for GRID. | 540 | "Return a list of solutions for GRID. |
| 523 | 541 | ||
| 524 | Given some grid GRID, the returned a list of solution LIST is | 542 | Given some grid GRID, the returned a list of solution LIST is |
| 525 | sorted from least Hamming weight to geatest one. | 543 | sorted from least Hamming weight to greatest one. |
| 526 | 544 | ||
| 527 | LIST = (SOLUTION-1 ... SOLUTION-N) | 545 | LIST = (SOLUTION-1 ... SOLUTION-N) |
| 528 | 546 | ||
| 529 | Each solution SOLUTION-I is a cons cell (HW . G) where HW is the | 547 | Each solution SOLUTION-I is a cons cell (HW . G) where HW is the |
| 530 | Hamming weight of the solution --- ie the number of strokes to | 548 | Hamming weight of the solution --- ie the number of strokes to |
| 531 | achieves it --- and G is the grid of positions to click in order | 549 | achieve it --- and G is the grid of positions to click in order |
| 532 | to complete the 5x5. | 550 | to complete the 5x5. |
| 533 | 551 | ||
| 534 | Solutions are sorted from least to greatest Hamming weight." | 552 | Solutions are sorted from least to greatest Hamming weight." |