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

Exercise 2.5 not working #62

Open
louisabraham opened this issue Aug 9, 2016 · 0 comments
Open

Exercise 2.5 not working #62

louisabraham opened this issue Aug 9, 2016 · 0 comments

Comments

@louisabraham
Copy link

louisabraham commented Aug 9, 2016

My code works but is not correctly evaluated. This occurs in other exercises as well.

(define (cons a b)
  (* (expt 2 a)
     (expt 3 b)))

(define (val n i)
  (if (zero? (modulo n i))
      (+ 1 (val (/ n i) i))
      0
  )
)

(define (car p) (val p 2))

(define (cdr p) (val p 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant