[aisleriot] fortunes: Don't use get-name.



commit c08e18dc9ea7acbee3517ad79655f61676861052
Author: Vincent Povirk <madewokherd gmail com>
Date:   Sun May 5 15:40:49 2013 -0500

    fortunes: Don't use get-name.
    
    For bug 551859.

 games/api.scm      |   69 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 games/fortunes.scm |    8 +----
 2 files changed, 71 insertions(+), 6 deletions(-)
---
diff --git a/games/api.scm b/games/api.scm
index ac21c90..a8dec41 100644
--- a/games/api.scm
+++ b/games/api.scm
@@ -553,6 +553,75 @@
 (define-public (hint-click slot-id hint-string)
   (list 0 hint-string))
 
+(define (get-remove-string card)
+  (let ((value (get-value card)) (suit (get-suit card)))
+       (cond ((is-joker? card)
+              (if (is-black? card) (_"Remove the black joker.") (_"Remove the red joker.")))
+             ((eq? suit club) 
+              (cond ((eq? value ace) (_"Remove the ace of clubs."))
+                    ((eq? value 2) (_"Remove the two of clubs."))
+                    ((eq? value 3) (_"Remove the three of clubs."))
+                    ((eq? value 4) (_"Remove the four of clubs."))
+                    ((eq? value 5) (_"Remove the five of clubs."))
+                    ((eq? value 6) (_"Remove the six of clubs."))
+                    ((eq? value 7) (_"Remove the seven of clubs."))
+                    ((eq? value 8) (_"Remove the eight of clubs."))
+                    ((eq? value 9) (_"Remove the nine of clubs."))
+                    ((eq? value 10) (_"Remove the ten of clubs."))
+                    ((eq? value jack) (_"Remove the jack of clubs."))
+                    ((eq? value queen) (_"Remove the queen of clubs."))
+                    ((eq? value king) (_"Remove the king of clubs."))
+                    (#t (_"Remove the unknown card."))))
+             ((eq? suit spade) 
+              (cond ((eq? value ace) (_"Remove the ace of spades."))
+                    ((eq? value 2) (_"Remove the two of spades."))
+                    ((eq? value 3) (_"Remove the three of spades."))
+                    ((eq? value 4) (_"Remove the four of spades."))
+                    ((eq? value 5) (_"Remove the five of spades."))
+                    ((eq? value 6) (_"Remove the six of spades."))
+                    ((eq? value 7) (_"Remove the seven of spades."))
+                    ((eq? value 8) (_"Remove the eight of spades."))
+                    ((eq? value 9) (_"Remove the nine of spades."))
+                    ((eq? value 10) (_"Remove the ten of spades."))
+                    ((eq? value jack) (_"Remove the jack of spades."))
+                    ((eq? value queen) (_"Remove the queen of spades."))
+                    ((eq? value king) (_"Remove the king of spades."))
+                    (#t (_"Remove the unknown card."))))
+             ((eq? suit heart) 
+              (cond ((eq? value ace) (_"Remove the ace of hearts."))
+                    ((eq? value 2) (_"Remove the two of hearts."))
+                    ((eq? value 3) (_"Remove the three of hearts."))
+                    ((eq? value 4) (_"Remove the four of hearts."))
+                    ((eq? value 5) (_"Remove the five of hearts."))
+                    ((eq? value 6) (_"Remove the six of hearts."))
+                    ((eq? value 7) (_"Remove the seven of hearts."))
+                    ((eq? value 8) (_"Remove the eight of hearts."))
+                    ((eq? value 9) (_"Remove the nine of hearts."))
+                    ((eq? value 10) (_"Remove the ten of hearts."))
+                    ((eq? value jack) (_"Remove the jack of hearts."))
+                    ((eq? value queen) (_"Remove the queen of hearts."))
+                    ((eq? value king) (_"Remove the king of hearts."))
+                    (#t (_"Remove the unknown card."))))
+             ((eq? suit diamond) 
+              (cond ((eq? value ace) (_"Remove the ace of diamonds."))
+                    ((eq? value 2) (_"Remove the two of diamonds."))
+                    ((eq? value 3) (_"Remove the three of diamonds."))
+                    ((eq? value 4) (_"Remove the four of diamonds."))
+                    ((eq? value 5) (_"Remove the five of diamonds."))
+                    ((eq? value 6) (_"Remove the six of diamonds."))
+                    ((eq? value 7) (_"Remove the seven of diamonds."))
+                    ((eq? value 8) (_"Remove the eight of diamonds."))
+                    ((eq? value 9) (_"Remove the nine of diamonds."))
+                    ((eq? value 10) (_"Remove the ten of diamonds."))
+                    ((eq? value jack) (_"Remove the jack of diamonds."))
+                    ((eq? value queen) (_"Remove the queen of diamonds."))
+                    ((eq? value king) (_"Remove the king of diamonds."))
+                    (#t (_"Remove the unknown card."))))
+             (#t (_"Remove the unknown card.")))))
+
+(define-public (hint-remove-top-card slot)
+  (hint-click slot (get-remove-string (get-top-card slot))))
+
 (define-public (move-n-cards! start-slot end-slot cards)
   (add-cards! end-slot cards))
 
diff --git a/games/fortunes.scm b/games/fortunes.scm
index c97494e..fa4eb33 100644
--- a/games/fortunes.scm
+++ b/games/fortunes.scm
@@ -131,12 +131,8 @@
                    (get-suit (get-top-card slot2))))
          (if (< (get-value (get-top-card slot1))
                 (get-value (get-top-card slot2)))
-             (list 0 (format #f 
-                              (_"Move ~a off the board") 
-                              (get-name (get-top-card slot1))))
-             (list 0 (format #f 
-                              (_"Move ~a off the board") 
-                              (get-name (get-top-card slot2)))))
+             (hint-remove-top-card slot1)
+             (hint-remove-top-card slot2))
          (check-hint slot1 (+ 1 slot2)))))
 
 (define (get-hint)


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