emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/mines 909152f 19/43: * mines.el (mines-dig): Update ele


From: Stefan Monnier
Subject: [elpa] externals/mines 909152f 19/43: * mines.el (mines-dig): Update element at point after avoid gameover in 1st trial
Date: Mon, 30 Nov 2020 18:44:16 -0500 (EST)

branch: externals/mines
commit 909152fd6226b6d4eeb0e86d31bfcc078c5c4cc6
Author: Tino Calancha <tino.calancha@gmail.com>
Commit: Tino Calancha <tino.calancha@gmail.com>

    * mines.el (mines-dig): Update element at point after avoid gameover in 1st 
trial
---
 mines.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mines.el b/mines.el
index a88386a..50869aa 100644
--- a/mines.el
+++ b/mines.el
@@ -472,7 +472,6 @@ If called again then unflag it."
                               (when (and (eq elt t) mines-protect-first-move 
(mines-first-move-p))
                                 (let ((ok-pos (cl-position-if-not (lambda (x) 
(eq t x)) mines-grid)))
                                   (message "Avoided game over in the first 
move")
-                                  (setq elt (aref mines-grid ok-pos))
                                   ;; Update mine positions.
                                   (setf (nth (cl-position idx 
mines-mine-positions)
                                              mines-mine-positions) ok-pos)
@@ -485,7 +484,9 @@ If called again then unflag it."
                                   (dolist (pos mines-mine-positions)
                                     (aset mines-grid pos t))
                                   ;; Update the numbers on neighbour cells.
-                                  (mines-set-numbers)))
+                                  (mines-set-numbers)
+                                  ;; Update current element. 
+                                  (setq elt (aref mines-grid idx))))
                               ;; If the cell is flagged ask for confirmation.
                               (if (and (not show-mines) (eq (following-char) 
mines-flagged-cell-char))
                                   (if (yes-or-no-p "This cell is flagged as 
having a bomb.  Uncover it? ")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]