[aisleriot] spider: Use hint-move instead of get-name.
- From: Vincent Povirk <vpovirk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] spider: Use hint-move instead of get-name.
- Date: Thu, 9 Aug 2012 23:19:23 +0000 (UTC)
commit f6620ea7bbaf0fea9e1c410bba2d492044db9696
Author: Vincent Povirk <madewokherd gmail com>
Date: Thu Aug 9 12:45:29 2012 -0500
spider: Use hint-move instead of get-name.
For bug 551859.
games/spider.scm | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/games/spider.scm b/games/spider.scm
index 9ef600c..3e3e489 100644
--- a/games/spider.scm
+++ b/games/spider.scm
@@ -235,6 +235,16 @@
(depth-card (cdr card-list))
card-list))
+(define (depth-card-pos card-list acc)
+ (if (and (> (length card-list) 1)
+ (is-visible? (cadr card-list))
+ (eq? (get-suit (car card-list))
+ (get-suit (cadr card-list)))
+ (eq? (+ 1 (get-value (car card-list)))
+ (get-value (cadr card-list))))
+ (depth-card-pos (cdr card-list) (+ acc 1))
+ acc))
+
(define (check-a-slot source card-to-move targets same-suit?)
(if (eq? targets '())
#f
@@ -245,9 +255,7 @@
(get-suit (get-top-card (car targets)))))
(= (+ 1 (get-value card-to-move))
(get-value (get-top-card (car targets)))))
- (list 1
- (get-name card-to-move)
- (get-name (get-top-card (car targets))))
+ (hint-move source (depth-card-pos (get-cards source) 1) (car targets))
(check-a-slot source card-to-move (cdr targets) same-suit?))))
(define (same-suit-check slots)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]