17
17
; You should have received a copy of the GNU General Public License
18
18
; along with this program. If not, see <http://www.gnu.org/licenses/>.
20
(use-modules (aisleriot interface) (aisleriot api))
20
22
;; @(#) $Id: plait.scm,v 1.14 2005/07/10 07:08:54 callum Exp $
88
90
(and (not (null? home-list))
89
91
(if (and (not (empty-slot? slot))
90
92
(move-possible? (get-top-card slot) (car home-list)))
91
(if (not (empty-slot? (car home-list)))
92
(list 1 (get-name (get-top-card slot))
93
(get-name (get-top-card (car home-list))))
94
(list 0 (format #f (_"Move ~a to an empty field") (get-name (get-top-card slot)))))
93
(hint-move slot 1 (car home-list))
95
94
(get-valid-move slot (cdr home-list)))))
97
96
(define (get-valid-moves slot-list home-list)
165
164
(get-and-increment-position-half)
166
(add-normal-slot '())
168
(add-extended-slot '() down)
170
(add-normal-slot '())
165
(add-normal-slot '() 'edge)
167
(add-extended-slot '() down 'plait)
169
(add-normal-slot '() 'edge)
171
170
(get-and-increment-position-half)
174
(add-normal-slot '())
175
(add-normal-slot '())
173
(add-normal-slot '() 'foundation)
174
(add-normal-slot '() 'foundation)
176
175
(add-carriage-return-slot)
178
(add-normal-slot '())
179
(add-normal-slot '())
182
(add-normal-slot '())
183
(add-normal-slot '())
177
(add-normal-slot '() 'tableau)
178
(add-normal-slot '() 'tableau)
181
(add-normal-slot '() 'tableau)
182
(add-normal-slot '() 'tableau)
184
183
(set! VERTPOS (+ VERTPOS 0.5))
185
(add-normal-slot '())
186
(add-normal-slot DECK)
184
(add-normal-slot '() 'waste)
185
(add-normal-slot DECK 'stock)
187
186
(set! VERTPOS (- VERTPOS 0.5))
188
(add-normal-slot '())
189
(add-normal-slot '())
190
(add-carriage-return-slot)
192
(add-normal-slot '())
193
(add-normal-slot '())
196
(add-normal-slot '())
197
(add-normal-slot '())
200
(add-normal-slot '())
201
(add-normal-slot '())
202
(add-carriage-return-slot)
204
(get-and-increment-position-half)
205
(add-normal-slot '())
209
(add-normal-slot '())
210
(get-and-increment-position-half)
213
(add-normal-slot '())
214
(add-normal-slot '())
187
(add-normal-slot '() 'foundation)
188
(add-normal-slot '() 'foundation)
189
(add-carriage-return-slot)
191
(add-normal-slot '() 'tableau)
192
(add-normal-slot '() 'tableau)
195
(add-normal-slot '() 'tableau)
196
(add-normal-slot '() 'tableau)
199
(add-normal-slot '() 'foundation)
200
(add-normal-slot '() 'foundation)
201
(add-carriage-return-slot)
203
(get-and-increment-position-half)
204
(add-normal-slot '() 'edge)
208
(add-normal-slot '() 'edge)
209
(get-and-increment-position-half)
212
(add-normal-slot '() 'foundation)
213
(add-normal-slot '() 'foundation)
215
214
(add-carriage-return-slot)
217
216
(deal-cards-face-up deck '(0
354
353
'(3 4 11 12 17 18 21 22))
356
355
(if (find-valid-move stock '(0 2 5 6 7 8 13 14 15 16 19 20))
357
(list 0 (format #f (_"Move ~a from the stock to an empty edge or tableau slot")
358
(get-name (get-top-card stock))))
356
(hint-move stock 1 (find-valid-move stock '(0 2 5 6 7 8 13 14 15 16 19 20)))
361
359
(define (game-cont)