[aisleriot] agnes: Do not shadow functions in api.scm
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] agnes: Do not shadow functions in api.scm
- Date: Sun, 13 Oct 2019 16:22:23 +0000 (UTC)
commit 45ebf1429617a912d3076f6d1b38f0fb28787907
Author: Otto Wallenius <owalleni gmail com>
Date: Sun Oct 13 18:20:08 2019 +0200
agnes: Do not shadow functions in api.scm
Shadowing function check-straight-descending might
cause unexpected behavior when playing other games
that use that api function after playing Agnes.
games/agnes.scm | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/games/agnes.scm b/games/agnes.scm
index 461cb343..39280ddc 100644
--- a/games/agnes.scm
+++ b/games/agnes.scm
@@ -86,21 +86,21 @@
(number->string (length (get-cards 0))))
(string-append (_"Stock left: 0"))))
-(define (check-straight-descending-list card-list)
+(define (check-straight-descending-list-base-low card-list)
(or (< (length card-list) 2)
(and (= (get-value (car card-list)) king)
(= (get-value (cadr card-list)) ace)
(not (= BASE-VAL ace))
- (check-straight-descending-list (cdr card-list)))
+ (check-straight-descending-list-base-low (cdr card-list)))
(and (= (get-value (car card-list)) (- (get-value (cadr card-list)) 1))
(not (= BASE-VAL (get-value (cadr card-list))))
- (check-straight-descending-list (cdr card-list)))))
+ (check-straight-descending-list-base-low (cdr card-list)))))
(define (button-pressed slot-id card-list)
(and (not (empty-slot? slot-id))
(is-visible? (car (reverse card-list)))
(check-same-color-list card-list)
- (check-straight-descending-list card-list)))
+ (check-straight-descending-list-base-low card-list)))
(define (droppable? start-slot card-list end-slot)
(cond ((= start-slot end-slot)
@@ -243,7 +243,7 @@
; (eq? (is-red? (car (reverse card-list)))
; (is-black? (car card-list)))
(not (check-same-color-list card-list))
- (not (check-straight-descending-list card-list)))
+ (not (check-straight-descending-list-base-low card-list)))
(strip (reverse (cdr (reverse card-list)))))
(#t (car (reverse card-list)))))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]