Commits

zck committed 8ef16bc

made 'mark, 'invert-marked, 'marked take (row, col) arguments instead of (col, row)

Comments (0)

Files changed (1)

minesweeper-mode.el

 				    (minesweeper-debug "inside inner loop -- setting up mine " (number-to-string col) " " (number-to-string row))
 				    (minesweeper-set-mine row col ?0)
 				    (minesweeper-hide row col)
-				    (minesweeper-unmark col row)))
+				    (minesweeper-unmark row col)))
   (minesweeper-debug "done setting zeros; now inserting mines")
   (minesweeper-insert-mines *minesweeper-mines* protect-col protect-row))
 
 	     (minesweeper-is-revealed row col))
 	 (gethash (list col row)
 		  *minesweeper-field*))
-	((minesweeper-marked col row)
+	((minesweeper-marked row col)
 	 ?*)
 	('t
 	 ?-)))
 (defun minesweeper-mark (row col)
   "Marks the square (row, col) as having a mine. It can't be selected until it is unmarked"
   (minesweeper-debug "marking square " (number-to-string row) "\t" (number-to-string col))
-  (unless (minesweeper-marked col row)
+  (unless (minesweeper-marked row col)
     (puthash (list col row)
 	     't
 	     *minesweeper-marks*)
     (setq *minesweeper-mark-count* (1+ *minesweeper-mark-count*))))
 
-(defun minesweeper-unmark (col row)
+(defun minesweeper-unmark (row col)
   "Removes the mark from (col, row). It can now be selected."
-  (when (minesweeper-marked col row)
+  (when (minesweeper-marked row col)
     (puthash (list col row)
 	     nil
 	     *minesweeper-marks*)
     (setq *minesweeper-mark-count* (1- *minesweeper-mark-count*))))
 
-(defun minesweeper-invert-mark (col row)
+(defun minesweeper-invert-mark (row col)
   "If (col, row) is marked, unmark it. Otherwise, mark it."
   (when (and (minesweeper-in-bounds row col)
 	     (not (minesweeper-is-revealed row col)))
-    (if (minesweeper-marked col row)
-	(minesweeper-unmark col row)
+    (if (minesweeper-marked row col)
+	(minesweeper-unmark row col)
       (minesweeper-mark row col))))
 
-(defun minesweeper-marked (col row)
+(defun minesweeper-marked (row col)
   "Returns 't if (col, row) is marked as having a mine, nil otherwise"
   (gethash (list col row)
 	   *minesweeper-marks*))
   (minesweeper-debug "starting pick with args:" (number-to-string col) " " (number-to-string row))
   (unless (or (not (minesweeper-in-bounds row col))
 	      (minesweeper-is-revealed row col)
-	      (minesweeper-marked col row))
+	      (minesweeper-marked row col))
     (minesweeper-debug "in pick, valid position chosen")
     (when *minesweeper-first-move*
       (minesweeper-debug "in pick, first-move is on. Calling view-mine.")
 		   (cur-row (cdr cur)))
 	      (minesweeper-debug "View-mine says " (number-to-string cur-col) ", " (number-to-string cur-row) " mine = " (make-string 1 (minesweeper-view-mine cur-row cur-col 't)))
 	      (unless (or (minesweeper-is-revealed cur-row cur-col)
-			  (minesweeper-marked cur-col cur-row))
+			  (minesweeper-marked cur-row cur-col))
 		(minesweeper-debug "it's not revealed, so reveal it")
 		(minesweeper-reveal cur-row cur-col)
 		(if (eq (setq *minesweeper-blanks-left* (1- *minesweeper-blanks-left*))
   (unless *minesweeper-game-over*
     (multiple-value-bind (row col in-bounds) (minesweeper-position)
       (when in-bounds
-        (minesweeper-invert-mark col row)
+        (minesweeper-invert-mark row col)
         (minesweeper-print-field)))))
 
 (defun minesweeper-toggle-mark-mouse (click)
 	   (col (car pos))
 	   (row (cdr pos)))
       (when (minesweeper-in-bounds col row)
-        (minesweeper-invert-mark col row)
+        (minesweeper-invert-mark row col)
         (select-window window)
         (minesweeper-print-field))
       (when (minesweeper-neighbors-bounds row col)