Cher Stéfan & tous, > Beware: I'm talking about make-variable-buffer-local, which is > different (but I think it's what you want here). Yes, this is what I meant, but I use this function so seldom that I mispelled it, and as I am my own spell-checker... Ok, I removed the function list and used a macro 5x5-defvar-local instead according to your kind recommendations. I also added a final message "5x5 Solution computation done." --- hopefully this is correct English --- to mask the obscure Calc verbiage. I also realized that there was a bug in 5x5, when making random grids, it was sometimes impossible for the solver to find a solution, and that happened while I was demonstrating the solver to my 6 years old son --- then I had to explained the reason for that kind of failure, which was incredibly more difficult than understand it and find a correction for it... I realized that the random grid generator was indeed making a grid whose each position is random, rather than making a set of random 5x5 moves. The former does not ensure the existence of a solution, while the latter does. I don't know if that was the initial intention to have this behaviour, but as « à l'impossible nul n'est tenu », I considered it a bug, and I corrected it along with providing the solver. So my contribution is 3 fold: I Add an arithmetic solver II Make 5x5 multisession III Ensure that random grids always have a solution --- this is a quick patch that makes it only when the grid size is 5, but I am not sure that that would work for other size, as I have not proved it mathematically. Here is the updated Changelog, I commonalized comment when possible. ----------------------------------------------------------------------- 2011-05-22 Vincent Belaïche * play/5x5.el: I/ Add an arithmetic solver to suggest positions to click on. II/ Make 5x5 multisession. III/ Ensure that random grids always have a solution in grid size = 5 cases (5x5-mode-map): Add keybinding to function `5x5-solve-suggest'. (5x5-solver-output): New defvar, output of function `5x5-solve-suggest'. (5x5-grid, 5x5-x-pos, 5x5-y-pos, 5x5-moves, 5x5-cracking): Make these variables buffer local to achieve 5x5 multi-session-ness. (5x5): Set 5x5-grid-size only if SIZE is non-negative. (5x5-grid-to-vec): New defun. Convert a 5x5 game grid into a Calc matrix in Z/2Z. (5x5-vec-to-grid): New defun. Convert a Calc matrix in Z/2Z into a 5x5 game grid. (5x5-log-buffer): New defvar. Not defined, provisionned for debugging Arithmetric solver. (5x5-log-init): New defun. Defined to dummy, provisionned for debugging Arithmetric solver. (5x5-log): New defun. Defined to dummy, provisionned for debugging Arithmetric solver. (5x5-solver): New defun, make the actual algorithm of arithmetic solver, to be usable that function needs some wrapper to the 5x5 user interace, this wapper is function `5x5-solve-suggest' for invocation, and function `5x5-draw-grid' for the diplay. (5x5-solve-suggest): New defun, invoke the arithmetic solver, and display solution. (5x5-randomize): Use 5x5-make-move instead of 5x5-flip-cell to randomize a grid so that we ensure that there is always a solution. (5x5-make-random-grid) allow other movement than flipping. ----------------------------------------------------------------------- VBR, Vincent