cs-pub-ro / PP-laboratoare

Laboratoare PP la seriile CA-CB-CC

Home Page:https://ocw.cs.pub.ro/courses/pp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lab1/ex5: Tests pass with incomplete solution

dumitrache-adrian92 opened this issue · comments

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.