[aisleriot] eagle-wing: Use hint-move instead of get-name.
- From: Vincent Povirk <vpovirk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] eagle-wing: Use hint-move instead of get-name.
- Date: Mon, 28 May 2012 22:40:53 +0000 (UTC)
commit 6c7d993d62430cf213413ced24f080e8fc55e1b0
Author: Vincent Povirk <madewokherd gmail com>
Date: Mon May 28 10:46:25 2012 -0500
eagle-wing: Use hint-move instead of get-name.
For bug 551859.
games/eagle-wing.scm | 60 ++++++++++++++++++++++++-------------------------
1 files changed, 29 insertions(+), 31 deletions(-)
---
diff --git a/games/eagle-wing.scm b/games/eagle-wing.scm
index a7d440e..fc84e54 100644
--- a/games/eagle-wing.scm
+++ b/games/eagle-wing.scm
@@ -18,40 +18,46 @@
(define BASE-VAL 0)
+(define foundation '(2 3 4 5))
+(define tableau '(6 7 8 9 11 12 13 14))
+(define reserve 10)
+(define stock 0)
+(define waste 1)
+
(define (new-game)
(initialize-playing-area)
(set-ace-low)
(make-standard-deck)
(shuffle-deck)
- (add-normal-slot DECK)
- (add-normal-slot '()) ;waste
+ (add-normal-slot DECK 'stock)
+ (add-normal-slot '() 'waste)
(add-blank-slot)
- (add-normal-slot '())
- (add-normal-slot '())
- (add-normal-slot '())
- (add-normal-slot '())
+ (add-normal-slot '() 'foundation)
+ (add-normal-slot '() 'foundation)
+ (add-normal-slot '() 'foundation)
+ (add-normal-slot '() 'foundation)
(add-carriage-return-slot)
(set! VERTPOS (+ VERTPOS 0.2))
- (add-extended-slot '() down) ;tableau (slot 6)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (- VERTPOS 0.1))
- (add-extended-slot '() down) ;tableau (slot 7)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (- VERTPOS 0.1))
- (add-extended-slot '() down) ;tableau (slot 8)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (+ VERTPOS 0.1))
- (add-extended-slot '() down) ;tableau (slot 9)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (+ VERTPOS 0.25))
- (add-normal-slot '()) ;reserve (slot 10)
+ (add-normal-slot '() 'reserve)
(set! VERTPOS (- VERTPOS 0.25))
- (add-extended-slot '() down) ;tableau (slot 11)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (- VERTPOS 0.1))
- (add-extended-slot '() down) ;tableau (slot 12)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (+ VERTPOS 0.1))
- (add-extended-slot '() down) ;tableau (slot 13)
+ (add-extended-slot '() down 'tableau)
(set! VERTPOS (+ VERTPOS 0.1))
- (add-extended-slot '() down) ;tableau (slot 14)
+ (add-extended-slot '() down 'tableau)
(deal-cards-face-up 0 '(10))
(deal-cards 0 '(10 10 10 10 10 10 10 10 10 10 10 10 6 7 8 9 11 12 13 14 2))
@@ -266,23 +272,15 @@
(if (and (not (empty-slot? slot))
(is-visible? (get-top-card slot)))
(cond ((= (get-value (get-top-card slot)) BASE-VAL)
- (list 0 (format #f (_"Move ~a to an empty foundation") (get-name (get-top-card slot)))))
+ (hint-move slot 1 (find-empty-slot foundation)))
((check-a-foundation slot 2)
- (list 1
- (get-name (get-top-card slot))
- (get-name (get-top-card 2))))
+ (hint-move slot 1 2))
((check-a-foundation slot 3)
- (list 1
- (get-name (get-top-card slot))
- (get-name (get-top-card 3))))
+ (hint-move slot 1 3))
((check-a-foundation slot 4)
- (list 1
- (get-name (get-top-card slot))
- (get-name (get-top-card 4))))
+ (hint-move slot 1 4))
((check-a-foundation slot 5)
- (list 1
- (get-name (get-top-card slot))
- (get-name (get-top-card 5))))
+ (hint-move slot 1 5))
((= slot 1)
(check-to-foundation 6))
((< slot 14)
@@ -297,9 +295,9 @@
(define (check-empty-slot slot)
(if (and (empty-slot? slot)
(not (= slot 10)))
- (if (empty-slot? 1)
+ (if (empty-slot? waste)
#f
- (list 2 (get-name (get-top-card 1)) (_"an empty slot on tableau")))
+ (hint-move waste 1 slot))
(if (< slot 14)
(check-empty-slot (+ 1 slot))
#f)))
@@ -315,7 +313,7 @@
(get-value (get-top-card check-slot)))
(and (= (get-value card) king)
(= (get-value (get-top-card check-slot)) ace))))
- (list 1 (get-name card) (get-name (get-top-card check-slot)))
+ (hint-move slot 1 check-slot)
(if (< check-slot 14)
(check-to-tableau slot card (+ 1 check-slot))
#f)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]