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 20:56

By that I mean, it calls itself with the first line of the else, but would it ever get to the second line? It keeps calling itself until one of the conditions is met at the first line. Why is there a second line if it's never used?

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