[aisleriot] Remove the get-value-name and get-suit-name functions.



commit f8d572ca58319a95cf41f0a3d196573a33fa60a2
Author: Vincent Povirk <madewokherd gmail com>
Date:   Wed Sep 28 02:55:36 2011 -0500

    Remove the get-value-name and get-suit-name functions.
    
    It's probably not a good idea to use these, and the one use of get-value-name
    produces incorrect sentences even in English (!).

 games/Rules.HOWTO  |    3 ---
 games/doublets.scm |   18 +++++++++++++++++-
 games/sol.scm      |   23 -----------------------
 src/game.c         |   17 ++++++-----------
 4 files changed, 23 insertions(+), 38 deletions(-)
---
diff --git a/games/Rules.HOWTO b/games/Rules.HOWTO
index 8634877..ece4335 100644
--- a/games/Rules.HOWTO
+++ b/games/Rules.HOWTO
@@ -359,9 +359,6 @@ Quite a few are self explanatory:
 (check-alternating-color-list card-list)
 (check-straight-descending-list card-list) 
 (length card-list)
-(get-value-name value)    ; card value to string
-(get-suit-name suit)      ; card suit to string
-(get-joker-name card)     ; name of a particular joker 
 (get-name card)           ; card description as a string
 (set-cards! slot-id card-list) ; puts card-list into the slot "slot-id"
 (make-card value suit)   ; turn a value and a suit into a card
diff --git a/games/doublets.scm b/games/doublets.scm
index 17b1dbd..8b35888 100644
--- a/games/doublets.scm
+++ b/games/doublets.scm
@@ -151,10 +151,26 @@
 (define (game-won)
   (= 48 (length (get-cards 8))))
 
+(define (get-value-hint value)
+  (cond ((eq? value ace) (_"You are searching for an ace."))
+        ((eq? value 2) (_"You are searching for a two."))
+        ((eq? value 3) (_"You are searching for a three."))
+        ((eq? value 4) (_"You are searching for a four."))
+        ((eq? value 5) (_"You are searching for a five."))
+        ((eq? value 6) (_"You are searching for a six."))
+        ((eq? value 7) (_"You are searching for a seven."))
+        ((eq? value 8) (_"You are searching for an eight."))
+        ((eq? value 9) (_"You are searching for a nine."))
+        ((eq? value 10) (_"You are searching for a ten."))
+        ((eq? value jack) (_"You are searching for a jack."))
+        ((eq? value queen) (_"You are searching for a queen."))
+        ((eq? value king) (_"You are searching for a king."))
+        (#t (_"Unknown value"))))
+
 (define (get-hint)
   (let ((wanted (modulo (* 2 (get-value (get-top-card 8))) 
 			13)))
-    (list 4 (get-value-name wanted))))
+    (list 0 (get-value-hint wanted))))
 
 (define (get-options) #f)
 
diff --git a/games/sol.scm b/games/sol.scm
index 3cadd98..3ae6fd9 100644
--- a/games/sol.scm
+++ b/games/sol.scm
@@ -367,29 +367,6 @@
   (map display objs) (newline))
 
 ; hint procedures
-(define (get-value-name value)
-  (cond ((eq? value ace) (_"ace"))
-        ((eq? value 2) (_"two"))
-        ((eq? value 3) (_"three"))
-        ((eq? value 4) (_"four"))
-        ((eq? value 5) (_"five"))
-        ((eq? value 6) (_"six"))
-        ((eq? value 7) (_"seven"))
-        ((eq? value 8) (_"eight"))
-        ((eq? value 9) (_"nine"))
-        ((eq? value 10) (_"ten"))
-        ((eq? value jack) (_"jack"))
-        ((eq? value queen) (_"queen"))
-        ((eq? value king) (_"king"))
-        (#t (_"Unknown value"))))
-
-(define (get-suit-name suit)
-  (cond ((eq? suit club) (_"clubs"))
-        ((eq? suit spade) (_"spades"))
-        ((eq? suit heart) (_"hearts"))
-        ((eq? suit diamond) (_"diamonds"))
-        (#t (_"Unknown suit"))))
-
 (define (get-joker-name card) 
   (if (is-black? card) (_"black joker") (_"red joker")))
 
diff --git a/src/game.c b/src/game.c
index 6dc2b5c..83e3e3a 100644
--- a/src/game.c
+++ b/src/game.c
@@ -2187,17 +2187,12 @@ aisleriot_game_get_hint (AisleriotGame *game)
                  aisleriot_game_get_game_file (game));
       break;
 
-    case 4:
-      string1 = SCM_CADR (hint);
-      if (!scm_is_string (string1))
-        break;
-
-      str1 = scm_to_locale_string (string1);
-      scm_dynwind_free (str1);
-      if (!str1)
-        break;
-
-      message = g_strdup_printf (_("You are searching for a %s."), str1);
+    case 4: /* This is deprecated (due to i18n issues) do not use. */
+      g_warning ("This game uses a deprecated hint method (case 4).\n"
+                 "Please file a bug at http://bugzilla.gnome.org "
+                 "including this message and the name of the game "
+                 "you were playing, which is %s.\n",
+                 aisleriot_game_get_game_file (game));
       break;
 
     default:



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