summaryrefslogtreecommitdiff
path: root/lisp/play
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-05-23 20:36:06 -0700
committerGlenn Morris <rgm@gnu.org>2011-05-23 20:36:06 -0700
commiteb8a5e9b13d1536dc7a9ac8795917dd768a372ed (patch)
treeef883af7d1d52f0f2311595b400327885e587f5e /lisp/play
parenta2a25d24350857dda87e28d6b2695cccc41bb32e (diff)
downloademacs-eb8a5e9b13d1536dc7a9ac8795917dd768a372ed.tar.gz
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.
Diffstat (limited to 'lisp/play')
-rw-r--r--lisp/play/5x5.el26
1 files changed, 22 insertions, 4 deletions
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."
(cdr x))))
(cdr grid-matrix))))
+(eval-and-compile
(if nil; set to t to enable solver logging
(progn
(defvar 5x5-log-buffer nil)
@@ -499,7 +500,7 @@ position."
(setq 5x5-log-buffer (get-buffer-create "*5x5 LOG*"))))
(defun 5x5-log (name value)
- "Debug purpuse only.
+ "Debug purposes only.
Log a matrix VALUE of (mod B 2) forms, only B is output and
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."
(insert name ?= value-to-log ?\n))))
value))
(defmacro 5x5-log-init ())
- (defmacro 5x5-log (name value) value))
+ (defmacro 5x5-log (name value) value)))
+
+(declare-function math-map-vec "calc-vec" (f a))
+(declare-function math-sub "calc" (a b))
+(declare-function math-mul "calc" (a b))
+(declare-function math-make-intv "calc-forms" (mask lo hi))
+(declare-function math-reduce-vec "calc-vec" (a b))
+(declare-function math-format-number "calc" (a &optional prec))
+(declare-function math-pow "calc-misc" (a b))
+(declare-function calcFunc-arrange "calc-vec" (vec cols))
+(declare-function calcFunc-cvec "calc-vec" (obj &rest dims))
+(declare-function calcFunc-diag "calc-vec" (a &optional n))
+(declare-function calcFunc-trn "calc-vec" (mat))
+(declare-function calcFunc-inv "calc-misc" (m))
+(declare-function calcFunc-mrow "calc-vec" (mat n))
+(declare-function calcFunc-mcol "calc-vec" (mat n))
+(declare-function calcFunc-vconcat "calc-vec" (a b))
+(declare-function calcFunc-index "calc-vec" (n &optional start incr))
(defun 5x5-solver (grid)
"Return a list of solutions for GRID.
Given some grid GRID, the returned a list of solution LIST is
-sorted from least Hamming weight to geatest one.
+sorted from least Hamming weight to greatest one.
LIST = (SOLUTION-1 ... SOLUTION-N)
Each solution SOLUTION-I is a cons cell (HW . G) where HW is the
Hamming weight of the solution --- ie the number of strokes to
-achieves it --- and G is the grid of positions to click in order
+achieve it --- and G is the grid of positions to click in order
to complete the 5x5.
Solutions are sorted from least to greatest Hamming weight."