[aisleriot] treize: Use hint-move instead of get-name.
- From: Vincent Povirk <vpovirk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] treize: Use hint-move instead of get-name.
- Date: Sat, 30 Jun 2012 00:34:30 +0000 (UTC)
commit 83d04de164a30124b1cde5ff4d1f42bf2d109c7a
Author: Vincent Povirk <madewokherd gmail com>
Date: Fri Jun 29 17:43:05 2012 -0500
treize: Use hint-move instead of get-name.
For bug 551859.
games/treize.scm | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
---
diff --git a/games/treize.scm b/games/treize.scm
index d4ef54b..92dd999 100644
--- a/games/treize.scm
+++ b/games/treize.scm
@@ -275,6 +275,12 @@
(empty-slot? 1)
(empty-slot? 0)))
+(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 (check-move slot1 slot2)
(if (or (empty-slot? slot1)
(not (available? slot1 0)))
@@ -282,7 +288,7 @@
(check-move (+ 1 slot1) (+ 2 slot1))
#f)
(if (= king (get-value (get-top-card slot1)))
- (list 2 (get-name (get-top-card slot1)) (_"itself"))
+ (hint-click slot1 (hint-remove-king (get-suit (get-top-card slot1))))
(if (or (empty-slot? slot2)
(not (available? slot2 0))
(not (= 13 (+ (get-value (get-top-card slot1))
@@ -292,9 +298,7 @@
(if (< slot1 29)
(check-move (+ 1 slot1) (+ 2 slot1))
#f))
- (list 1
- (get-name (get-top-card slot1))
- (get-name (get-top-card slot2)))))))
+ (hint-move slot1 1 slot2)))))
(define (dealable?)
(if (not (empty-slot? 0))
@@ -306,9 +310,7 @@
(> (length (get-cards 2)) 1)
(= 13 (+ (get-value (get-top-card 2))
(get-value (cadr (get-cards 2)))))
- (list 1
- (get-name (get-top-card 2))
- (get-name (cadr (get-cards 2))))))
+ (hint-move 2 1 2)))
(define (get-hint)
(or (check-move 1 2)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]