Codebase list aisleriot / 79b14e8
diamond-mine: Do not shadow functions in api.scm Shadowing function find-card might cause other games to crash when played after Diamond Mine (bug 551859). Unrelated to that, one variable is renamed (size -> slot) for clarity and one redundant expression in a conditional statement is removed. Otto Wallenius authored 4 years ago Christian Persch committed 4 years ago
1 changed file(s) with 8 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
274274 (search-a-slot card-suit card-rank (cdr card-list)))
275275 (#t #f)))
276276
277 (define (find-card card-suit card-rank slot)
277 (define (visible-on-tableau? card-suit card-rank slot)
278278 (cond ((= slot 14)
279279 #f)
280280 ((and (not (empty-slot? slot))
281281 (search-a-slot card-suit card-rank (get-cards slot)))
282282 #t)
283 (#t (find-card card-suit card-rank (+ 1 slot)))))
284
285 (define (check-a-tab-slot card-list size)
283 (#t (visible-on-tableau? card-suit card-rank (+ 1 slot)))))
284
285 (define (check-a-tab-slot card-list slot)
286286 (cond ((or (< (length card-list) 2)
287287 (not (is-visible? (cadr card-list))))
288288 #f)
289 ((and (is-visible? (cadr card-list))
290 (not (= (get-suit (car card-list))
289 ((and (not (= (get-suit (car card-list))
291290 (get-suit (cadr card-list))))
292 (find-card (get-suit (car card-list)) (+ 1 (get-value (car card-list))) 1))
293 size)
294 (#t (check-a-tab-slot (cdr card-list) (+ size 1)))))
291 (visible-on-tableau? (get-suit (car card-list)) (+ 1 (get-value (car card-list))) 1))
292 slot)
293 (#t (check-a-tab-slot (cdr card-list) (+ slot 1)))))
295294
296295 (define (check-tableau-suit-changes slot)
297296 (cond ((or (= slot 14)