19
19
(def-save-var free-reserves 0)
21
(define foundation '(0 1 2 3))
22
(define reserve '(4 5 6 7 8 9 10 11))
23
(define tableau '(12 13 14 15 16 17 18 19))
22
26
(initialize-playing-area)
24
28
(make-standard-deck)
27
(add-normal-slot DECK)
28
(add-carriage-return-slot)
30
(add-carriage-return-slot)
32
(add-carriage-return-slot)
31
(add-normal-slot DECK 'foundation)
32
(add-carriage-return-slot)
33
(add-normal-slot '() 'foundation)
34
(add-carriage-return-slot)
35
(add-normal-slot '() 'foundation)
36
(add-carriage-return-slot)
37
(add-normal-slot '() 'foundation)
43
(add-normal-slot '() 'reserve)
44
(add-normal-slot '() 'reserve)
45
(add-normal-slot '() 'reserve)
46
(add-normal-slot '() 'reserve)
47
(add-normal-slot '() 'reserve)
48
(add-normal-slot '() 'reserve)
49
(add-normal-slot '() 'reserve)
50
(add-normal-slot '() 'reserve)
48
52
(add-carriage-return-slot)
53
(add-extended-slot '() down)
54
(add-extended-slot '() down)
55
(add-extended-slot '() down)
56
(add-extended-slot '() down)
57
(add-extended-slot '() down)
58
(add-extended-slot '() down)
59
(add-extended-slot '() down)
60
(add-extended-slot '() down)
57
(add-extended-slot '() down 'tableau)
58
(add-extended-slot '() down 'tableau)
59
(add-extended-slot '() down 'tableau)
60
(add-extended-slot '() down 'tableau)
61
(add-extended-slot '() down 'tableau)
62
(add-extended-slot '() down 'tableau)
63
(add-extended-slot '() down 'tableau)
64
(add-extended-slot '() down 'tableau)
62
66
(deal-cards-face-up 0 '(12 13 14 15 16 17 18 19 12 13 14 15 16 17 18
63
67
19 12 13 14 15 16 17 18 19 12 13 14 15 16
178
182
(check-to-foundations? (+ 1 slot) 0))
179
183
((= (get-value (get-top-card slot)) ace)
180
(list 2 (get-name (get-top-card slot)) (_"an empty foundation")))
184
(hint-move slot 1 (find-empty-slot foundation)))
181
185
((and (not (empty-slot? f-slot))
182
186
(= (get-suit (get-top-card slot))
183
187
(get-suit (get-top-card f-slot)))
184
188
(= (get-value (get-top-card slot))
185
189
(+ 1 (get-value (get-top-card f-slot)))))
186
(list 1 (get-name (get-top-card slot)) (get-name (get-top-card f-slot))))
190
(hint-move slot 1 f-slot))
187
191
(#t (check-to-foundations? slot (+ 1 f-slot)))))
189
193
(define (check-for-king card-list iter slot)
228
232
((and (not (= slot t-slot))
229
233
(empty-slot? t-slot)
230
234
(check-for-king (get-cards slot) free-reserves slot))
232
(check-for-king (get-cards slot) free-reserves slot)
233
(_"an empty tableau")))
235
(hint-move slot (- 14 (get-value (get-top-card slot))) t-slot))
234
236
((and (not (= slot t-slot))
235
237
(not (empty-slot? t-slot))
236
238
(= (get-suit (get-top-card slot))
238
240
(check-for-spec-card (get-cards slot)
240
242
(- (get-value (get-top-card t-slot)) 1)))
242
(get-name (make-card (- (get-value (get-top-card t-slot)) 1)
243
(get-suit (get-top-card t-slot))))
244
(get-name (get-top-card t-slot))))
243
(hint-move slot (- (get-value (get-top-card t-slot)) (get-value (get-top-card slot))) t-slot))
245
244
(#t (check-to-tableau? slot (+ 1 t-slot)))))
247
246
(define (check-for-empty-reserve)