gnome-games r9047 - in trunk/aisleriot: . rules



Author: vpovirk
Date: Mon Apr 13 05:09:13 2009
New Revision: 9047
URL: http://svn.gnome.org/viewvc/gnome-games?rev=9047&view=rev

Log:
aisleriot: change the flippable? api to account for the waste pile


Modified:
   trunk/aisleriot/rules/backbone.scm
   trunk/aisleriot/rules/doublets.scm
   trunk/aisleriot/rules/eagle_wing.scm
   trunk/aisleriot/rules/klondike.scm
   trunk/aisleriot/rules/straight_up.scm
   trunk/aisleriot/rules/terrace.scm
   trunk/aisleriot/rules/thumb_and_pouch.scm
   trunk/aisleriot/rules/whitehead.scm
   trunk/aisleriot/rules/zebra.scm
   trunk/aisleriot/sol.scm

Modified: trunk/aisleriot/rules/backbone.scm
==============================================================================
--- trunk/aisleriot/rules/backbone.scm	(original)
+++ trunk/aisleriot/rules/backbone.scm	Mon Apr 13 05:09:13 2009
@@ -183,7 +183,7 @@
        (complete-transaction start-slot card-list end-slot)))
 
 (define (dealable?)
-  (flippable? stock 1))
+  (flippable? stock waste 1))
 
 (define (do-deal-next-cards)
   (flip-stock stock waste 1 1))

Modified: trunk/aisleriot/rules/doublets.scm
==============================================================================
--- trunk/aisleriot/rules/doublets.scm	(original)
+++ trunk/aisleriot/rules/doublets.scm	Mon Apr 13 05:09:13 2009
@@ -107,7 +107,7 @@
 	       (#t #t)))))
 
 (define (dealable?)
-  (flippable? 0 2))
+  (flippable? 0 1 2))
 
 (define (do-deal-next-cards)
    (flip-stock 0 1 2))

Modified: trunk/aisleriot/rules/eagle_wing.scm
==============================================================================
--- trunk/aisleriot/rules/eagle_wing.scm	(original)
+++ trunk/aisleriot/rules/eagle_wing.scm	Mon Apr 13 05:09:13 2009
@@ -157,7 +157,7 @@
        (complete-transaction start-slot (reverse card-list) end-slot)))
 
 (define (dealable?)
-  (flippable? 0 2))
+  (flippable? 0 1 2))
 
 (define (do-deal-next-cards)
   (begin

Modified: trunk/aisleriot/rules/klondike.scm
==============================================================================
--- trunk/aisleriot/rules/klondike.scm	(original)
+++ trunk/aisleriot/rules/klondike.scm	Mon Apr 13 05:09:13 2009
@@ -128,7 +128,7 @@
 			    (- (get-value (car card-list)) 1))))))))
 
 (define (dealable?)
-  (flippable? stock max-redeal))
+  (flippable? stock waste max-redeal))
 
 (define (do-deal-next-cards)
   (flip-stock stock waste max-redeal (if deal-three 3 1)))

Modified: trunk/aisleriot/rules/straight_up.scm
==============================================================================
--- trunk/aisleriot/rules/straight_up.scm	(original)
+++ trunk/aisleriot/rules/straight_up.scm	Mon Apr 13 05:09:13 2009
@@ -157,7 +157,7 @@
        (check-up slot-id 2)))
 
 (define (dealable?)
-  (flippable? 0 2))
+  (flippable? 0 1 2))
   
 (define (do-deal-next-cards)
   (and (flip-stock 0 1 2)

Modified: trunk/aisleriot/rules/terrace.scm
==============================================================================
--- trunk/aisleriot/rules/terrace.scm	(original)
+++ trunk/aisleriot/rules/terrace.scm	Mon Apr 13 05:09:13 2009
@@ -244,7 +244,7 @@
 
 (define (dealable?)
   (and (not (= 0 BASE-VAL))
-       (flippable? stock max-redeal)
+       (flippable? stock waste max-redeal)
        ;Do not allow deals if we've been through the deck once and the waste is not empty
        (or (< FLIP-COUNTER 1)
            (empty-slot? waste))

Modified: trunk/aisleriot/rules/thumb_and_pouch.scm
==============================================================================
--- trunk/aisleriot/rules/thumb_and_pouch.scm	(original)
+++ trunk/aisleriot/rules/thumb_and_pouch.scm	Mon Apr 13 05:09:13 2009
@@ -141,7 +141,7 @@
   (give-status-message))
 
 (define (dealable?)
-  (flippable? 0 2))
+  (flippable? 0 1 2))
 
 (define (game-continuable)
   (get-hint))

Modified: trunk/aisleriot/rules/whitehead.scm
==============================================================================
--- trunk/aisleriot/rules/whitehead.scm	(original)
+++ trunk/aisleriot/rules/whitehead.scm	Mon Apr 13 05:09:13 2009
@@ -106,7 +106,7 @@
        (do-deal-next-cards)))
 
 (define (dealable?)
-  (flippable? 0 0))
+  (flippable? 0 1 0))
 
 (define (check-to-foundation card f-slot)
   (cond ((= f-slot 6)

Modified: trunk/aisleriot/rules/zebra.scm
==============================================================================
--- trunk/aisleriot/rules/zebra.scm	(original)
+++ trunk/aisleriot/rules/zebra.scm	Mon Apr 13 05:09:13 2009
@@ -121,7 +121,7 @@
   (give-status-message))
 
 (define (dealable?)
-  (flippable? 0 1))
+  (flippable? 0 1 1))
 
 (define (button-clicked slot-id)
   (and (= slot-id 0)

Modified: trunk/aisleriot/sol.scm
==============================================================================
--- trunk/aisleriot/sol.scm	(original)
+++ trunk/aisleriot/sol.scm	Mon Apr 13 05:09:13 2009
@@ -230,10 +230,11 @@
 
 ;; Utilities
 
-(define (flippable? stock-slot flip-limit)
+(define (flippable? stock-slot waste-slot flip-limit)
   (or (not (empty-slot? stock-slot))
-      (< flip-limit 0)
-      (< FLIP-COUNTER flip-limit)))
+      (and (not (empty-slot? waste-slot))
+           (or (< flip-limit 0)
+               (< FLIP-COUNTER flip-limit)))))
 
 ; deal a card from the stock-slot to the waste-slot.
 ; when the stock slot is empty than the waste slot will be flipped back



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