Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

DERP

Name: HERP 2010-07-22 20:53

(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1)
(A x (- y 1))))))

I understand everything up until the else.
HALP.

Name: Anonymous 2010-07-22 21:04

>>3
Sorry, it's copypasted straight from my SICP pdf.
(define (A x y)
  (cond ((= y 0) 0)
        ((= x 0) (* 2 y))
        ((= y 1) 2)
        (else (A (- x 1)
                 (A x (- y 1))))))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List