[aisleriot] neighbor: Use hint-move instead of get-name.



commit 7150fe9c67328fc7dd6b9e621a0562b534cb7b9c
Author: Vincent Povirk <madewokherd gmail com>
Date:   Fri Jun 29 15:43:39 2012 -0500

    neighbor: Use hint-move instead of get-name.
    
    For bug 551859.

 games/neighbor.scm |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/games/neighbor.scm b/games/neighbor.scm
index 9335c15..94c6a97 100644
--- a/games/neighbor.scm
+++ b/games/neighbor.scm
@@ -137,9 +137,15 @@
   (and (not (game-won))
        (get-hint)))
 
+(define (hint-remove-king suit)
+  (cond ((eq? suit club) (_"Remove the king of clubs."))
+        ((eq? suit diamond) (_"Remove the king of diamonds."))
+        ((eq? suit heart) (_"Remove the king of hearts."))
+        ((eq? suit spade) (_"Remove the king of spades."))))
+
 (define (king-check slot-id)
   (cond ((= king (get-value (get-top-card slot-id)))
-	 (list 2 (get-name (get-top-card slot-id)) (_"itself")))
+	 (hint-click slot-id (hint-remove-king (get-suit (get-top-card slot-id)))))
 	((and (< slot-id 25)
 	      (not (empty-slot? (+ 1 slot-id))))
 	 (king-check (+ 1 slot-id)))
@@ -149,8 +155,7 @@
   (cond ((and (not (= 0 (modulo slot-id 5)))
 	      (= 13 (+ (get-value (get-top-card slot-id))
 		       (get-value (get-top-card (+ 1 slot-id))))))
-	 (list 1 (get-name (get-top-card slot-id))
-	       (get-name (get-top-card (+ 1 slot-id)))))
+	 (hint-move slot-id 1 (+ 1 slot-id)))
 	((and (< slot-id 24)
 	      (not (empty-slot? (+ 2 slot-id))))
 	 (horizontal-check (+ 1 slot-id)))
@@ -159,8 +164,7 @@
 (define (vertical-check slot-id)
   (cond ((= 13 (+ (get-value (get-top-card slot-id))
 		  (get-value (get-top-card (+ 5 slot-id)))))
-	 (list 1 (get-name (get-top-card slot-id))
-	       (get-name (get-top-card (+ 5 slot-id)))))
+	 (hint-move slot-id 1 (+ 5 slot-id)))
 	((and (< slot-id 19)
 	      (not (empty-slot? (+ 6 slot-id))))
 	 (vertical-check (+ 1 slot-id)))
@@ -170,8 +174,7 @@
   (cond ((and (not (= 0 (modulo slot-id 5)))
 	      (= 13 (+ (get-value (get-top-card slot-id))
 		       (get-value (get-top-card (+ 6 slot-id))))))
-	 (list 1 (get-name (get-top-card slot-id))
-	       (get-name (get-top-card (+ 6 slot-id)))))
+	 (hint-move slot-id 1 (+ 6 slot-id)))
 	((and (not (empty-slot? (+ 7 slot-id)))
 	      (< slot-id 18))
 	 (backslash-check (+ 1 slot-id)))
@@ -181,8 +184,7 @@
   (cond ((and (not (= 1 (modulo slot-id 5)))
 	      (= 13 (+ (get-value (get-top-card slot-id))
 		       (get-value (get-top-card (+ 4 slot-id))))))
-	 (list 1 (get-name (get-top-card slot-id))
-	       (get-name (get-top-card (+ 4 slot-id)))))
+	 (hint-move slot-id 1 (+ 4 slot-id)))
 	((and (< slot-id 19)
 	      (not (empty-slot? (+ 5 slot-id))))
 	 (slash-check (+ 1 slot-id)))



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