[gnome-games] aisleriot/poker: End game when last card is placed outside shuffle mode.



commit 808df4f382685cd3bfbb9be714ec5893dfb42466
Author: Vincent Povirk <madewokherd gmail com>
Date:   Fri Nov 26 19:37:02 2010 -0600

    aisleriot/poker: End game when last card is placed outside shuffle mode.
    
    For bug 392743.

 aisleriot/rules/poker.scm |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/aisleriot/rules/poker.scm b/aisleriot/rules/poker.scm
index 8390fe8..636d6c8 100644
--- a/aisleriot/rules/poker.scm
+++ b/aisleriot/rules/poker.scm
@@ -267,6 +267,7 @@
            (deal-cards end-slot (list start-slot)))
        (move-n-cards! start-slot end-slot card-list)
        (or (> start-slot 1)
+           (= (length (get-cards 0)) 27)
            (deal-cards-face-up 0 '(1)))
        (recalculate-score)))
 
@@ -276,9 +277,14 @@
 (define (button-double-clicked slot-id)
   #f)
 
+(define (all-slots-full slot-id)
+  (or (= slot-id 27)
+      (and (not (empty-slot? slot-id))
+           (all-slots-full (+ slot-id 1)))))
+
 (define (game-continuable)
-  (or (> (length (get-cards 0)) 27)
-      (not (empty-slot? 1))))
+  (or shuffle-mode
+      (not (all-slots-full 2))))
 
 (define (game-won)
   (if shuffle-mode



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