Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "Problem 5"
- (define (encode p)
- (+ (* .5
- (+ (car p) (cdr p) -2)
- (+ (car p) (cdr p) -1))
- (car p)))
- "Problem 5b"
- (define (decode z)
- (let* ((w (- (sqrt(* 2 z)) .5))
- (t (/ (+ (* w w) w) 2))
- (x (- z t))
- (y (- w x -2)))
- (cons x y)))
- (decode 32)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement