learning-sicp

My embarrassing half assed SICP run.
git clone https://kaka.farm/~git/learning-sicp
Log | Files | Refs

exercise-12.scm (356B)


      1 (define-library (sicp solutions chapter-1 exercise-12)
      2   (import (scheme base))
      3   (export pascal)
      4 
      5   (begin
      6     (define (pascal line column)
      7       (cond
      8        ((or (= column 0)
      9             (= column line)) 1)
     10        (else (+ (pascal (- line 1)
     11                         (- column 1))
     12                 (pascal (- line 1)
     13                         column)))))))