[aisleriot] clock: Change goal to revealing all cards.
- From: Vincent Povirk <vpovirk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] clock: Change goal to revealing all cards.
- Date: Sun, 9 Oct 2011 16:09:19 +0000 (UTC)
commit 565bb5c7c2b062c40d4c1c58263db8e0cbd16da4
Author: Vincent Povirk <madewokherd gmail com>
Date: Sun Oct 9 11:06:38 2011 -0500
clock: Change goal to revealing all cards.
For bug 390585.
games/clock.scm | 74 ++++++++---------------------------------------------
help/C/clock.xml | 3 +-
2 files changed, 13 insertions(+), 64 deletions(-)
---
diff --git a/games/clock.scm b/games/clock.scm
index 7c71251..fdd7bf0 100644
--- a/games/clock.scm
+++ b/games/clock.scm
@@ -139,74 +139,24 @@
(complete-transaction (list top-card) slot))))
#f))
-(define (make-all-visible slot)
- (if (< slot 13)
- (begin
- (make-visible (car (get-cards slot)))
- (make-visible (cadr (get-cards slot)))
- (make-visible (caddr (get-cards slot)))
- (make-visible (cadddr (get-cards slot)))
- (make-all-visible (+ slot 1)))))
+(define (all-cards-visible cards)
+ (if (eq? cards '())
+ #t
+ (and (is-visible? (car cards))
+ (all-cards-visible (cdr cards)))))
+(define (all-slots-visible first-slot)
+ (if (= first-slot 13)
+ #t
+ (and (all-cards-visible (get-cards first-slot))
+ (all-slots-visible (+ first-slot 1)))))
(define (game-won)
- (make-all-visible 0)
- (if (and (= (get-value (car (get-cards 2))) 1)
- (= (get-value (cadr (get-cards 2))) 1)
- (= (get-value (caddr (get-cards 2))) 1)
- (= (get-value (cadddr (get-cards 2))) 1)
- (= (get-value (car (get-cards 4))) 2)
- (= (get-value (cadr (get-cards 4))) 2)
- (= (get-value (caddr (get-cards 4))) 2)
- (= (get-value (cadddr (get-cards 4))) 2)
- (= (get-value (car (get-cards 7))) 3)
- (= (get-value (cadr (get-cards 7))) 3)
- (= (get-value (caddr (get-cards 7))) 3)
- (= (get-value (cadddr (get-cards 7))) 3)
- (= (get-value (car (get-cards 9))) 4)
- (= (get-value (cadr (get-cards 9))) 4)
- (= (get-value (caddr (get-cards 9))) 4)
- (= (get-value (cadddr (get-cards 9))) 4)
- (= (get-value (car (get-cards 12))) 5)
- (= (get-value (cadr (get-cards 12))) 5)
- (= (get-value (caddr (get-cards 12))) 5)
- (= (get-value (cadddr (get-cards 12))) 5)
- (= (get-value (car (get-cards 11))) 6)
- (= (get-value (cadr (get-cards 11))) 6)
- (= (get-value (caddr (get-cards 11))) 6)
- (= (get-value (cadddr (get-cards 11))) 6)
- (= (get-value (car (get-cards 10))) 7)
- (= (get-value (cadr (get-cards 10))) 7)
- (= (get-value (caddr (get-cards 10))) 7)
- (= (get-value (cadddr (get-cards 10))) 7)
- (= (get-value (car (get-cards 8))) 8)
- (= (get-value (cadr (get-cards 8))) 8)
- (= (get-value (caddr (get-cards 8))) 8)
- (= (get-value (cadddr (get-cards 8))) 8)
- (= (get-value (car (get-cards 5))) 9)
- (= (get-value (cadr (get-cards 5))) 9)
- (= (get-value (caddr (get-cards 5))) 9)
- (= (get-value (cadddr (get-cards 5))) 9)
- (= (get-value (car (get-cards 3))) 10)
- (= (get-value (cadr (get-cards 3))) 10)
- (= (get-value (caddr (get-cards 3))) 10)
- (= (get-value (cadddr (get-cards 3))) 10)
- (= (get-value (car (get-cards 0))) 11)
- (= (get-value (cadr (get-cards 0))) 11)
- (= (get-value (caddr (get-cards 0))) 11)
- (= (get-value (cadddr (get-cards 0))) 11)
- (= (get-value (car (get-cards 1))) 12)
- (= (get-value (cadr (get-cards 1))) 12)
- (= (get-value (caddr (get-cards 1))) 12)
- (= (get-value (cadddr (get-cards 1))) 12)
- )
- #t
- #f))
+ (all-slots-visible 0))
(define (game-over)
(not (and (is-visible? (car (reverse (get-cards 6))))
- (= (get-value (get-top-card 6)) king)
- (make-all-visible 0))))
+ (= (get-value (get-top-card 6)) king))))
(define (nth-item list n)
(if (= 0 n)
diff --git a/help/C/clock.xml b/help/C/clock.xml
index 46cbf0a..5a17374 100644
--- a/help/C/clock.xml
+++ b/help/C/clock.xml
@@ -50,8 +50,7 @@
<sect2><title>Goal</title>
<para>
- To have all four cards in each pile be the rank corresponding to the
- number on a clock face.
+ To reveal all the cards.
</para>
</sect2>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]