Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lab1/ex5: Tests pass with incomplete solution #47

Open
dumitrache-adrian92 opened this issue Mar 1, 2024 · 0 comments · May be fixed by #48
Open

lab1/ex5: Tests pass with incomplete solution #47

dumitrache-adrian92 opened this issue Mar 1, 2024 · 0 comments · May be fixed by #48
Assignees
Labels
bug Something isn't working laborator racket

Comments

@dumitrache-adrian92
Copy link

An incomplete solution which only checks if the number is a palindrome in the first base of the Bases list such as this:

(define (all-palindromes? n Bases)
  (cond ((null? Bases) #t)
        ((palindrome? (num->base n (car Bases))) #t)
        (else #f)
        )
  )

will still pass the tests.

This is especially confusing for students if they end up using this function in exercise 7 as this approach will fail those tests.

At least one more test should be added to fix this.

@dumitrache-adrian92 dumitrache-adrian92 added bug Something isn't working racket laborator labels Mar 1, 2024
@dumitrache-adrian92 dumitrache-adrian92 self-assigned this Mar 1, 2024
dumitrache-adrian92 added a commit to dumitrache-adrian92/PP-laboratoare that referenced this issue Mar 1, 2024
As described in cs-pub-ro#47, the tests are fully passing with a specific wrong
solution. This PR fixes that by adding another test to catch mistake.

Signed-off-by: Adrian-George Dumitrache <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working laborator racket
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant