Welcome to the CHICKEN Scheme pasting service

midpointdisplacement added by anonymous on Wed Dec 19 08:14:42 2018

;;; ~/mda.scm

(define mda (lambda (vec p1 p2)
    (define midpoint (+ p1 (/ (- p2 p1) 2)))
    (if (> (- p2 p1) 1)
        (begin
        (vector-set! vec midpoint (floor (/ (+ (vector-ref vec p1) (vector-ref vec p2)) 2)))
        (mda vec p1 midpoint)
        (mda vec midpoint p2)))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What module provides regular expressions support?
Visually impaired? Let me spell it for you (wav file) download WAV