--- klondike-old.scm	2005-04-28 13:56:11.002526400 +0000
+++ klondike.scm	2005-04-28 14:27:05.830549680 +0000
@@ -115,7 +115,9 @@
        (flip-stock stock waste 2 (if deal-three 3 1))))
 
 (define (button-double-clicked start-slot)
-  (and (member start-slot (cons waste tableau))
+   (or (and (member start-slot foundation)
+            (autoplay-foundations))
+   (and (member start-slot (cons waste tableau))
        (not (empty-slot? start-slot))
        (let* ((card (get-top-card start-slot))
 	      (suit (get-suit card))
@@ -138,8 +140,16 @@
 		(or (= ace value)
 		    (= (get-value (get-top-card end-slot)) (- value 1)))
 		(remove-card start-slot)
-		(complete-transaction start-slot (list card) end-slot))))))
+		(complete-transaction start-slot (list card) end-slot)))))))
 
+(define (autoplay-foundations)
+  (define (autoplay-foundations-tail)
+    (if (or-map button-double-clicked (cons waste tableau))
+        (autoplay-foundations-tail)
+        #t))
+  (if (or-map button-double-clicked (cons waste tableau))
+      (autoplay-foundations-tail)
+      #f))
 
 ; Global variables used in searching (keeping it simple):
 
